summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--man.c6
-rw-r--r--mdoc.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/man.c b/man.c
index f2031616..b14f9897 100644
--- a/man.c
+++ b/man.c
@@ -493,6 +493,12 @@ man_pmacro(struct man *m, int ln, char *buf)
break;
else if (' ' == buf[i])
break;
+
+ /* Check for invalid characters. */
+
+ if (isgraph((u_char)buf[i]))
+ continue;
+ return(man_perr(m, ln, i, WNPRINT));
}
mac[j] = 0;
diff --git a/mdoc.c b/mdoc.c
index f425d4f4..354a2e8f 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -709,6 +709,12 @@ parsemacro(struct mdoc *m, int ln, char *buf)
break;
else if (' ' == buf[i])
break;
+
+ /* Check for invalid characters. */
+
+ if (isgraph((u_char)buf[i]))
+ continue;
+ return(mdoc_perr(m, ln, i, EPRINT));
}
mac[j] = 0;