summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mandoc/man.c8
-rw-r--r--usr.bin/mandoc/mdoc.c8
2 files changed, 14 insertions, 2 deletions
diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c
index 009a25ef413..ab25e160094 100644
--- a/usr.bin/mandoc/man.c
+++ b/usr.bin/mandoc/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.10 2009/08/22 23:17:39 schwarze Exp $ */
+/* $Id: man.c,v 1.11 2009/09/18 22:37:05 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -489,6 +489,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/usr.bin/mandoc/mdoc.c b/usr.bin/mandoc/mdoc.c
index 803e8143aaf..da3983aca93 100644
--- a/usr.bin/mandoc/mdoc.c
+++ b/usr.bin/mandoc/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.25 2009/08/22 21:55:06 schwarze Exp $ */
+/* $Id: mdoc.c,v 1.26 2009/09/18 22:37:05 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -705,6 +705,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;