summaryrefslogtreecommitdiffstats
path: root/validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-02-24 13:46:54 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-02-24 13:46:54 +0000
commit38fefdf005d8237391f4aabfb145c4a96d930b8b (patch)
tree3140d1ac71c9d4d0d8ed643bc9937302d4cf9379 /validate.c
parentc8bf126a0b893c247fa4ec7b271fa51308fe257f (diff)
downloadmandoc-38fefdf005d8237391f4aabfb145c4a96d930b8b.tar.gz
Character-encoding checked for all text (arguments/values).
Diffstat (limited to 'validate.c')
-rw-r--r--validate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/validate.c b/validate.c
index dcc7f4ce..82f69874 100644
--- a/validate.c
+++ b/validate.c
@@ -17,6 +17,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
#include <assert.h>
+#include <ctype.h>
#include <stdlib.h>
#include "private.h"
@@ -396,6 +397,9 @@ check_text(struct mdoc *mdoc, size_t line, size_t pos, const char *p)
size_t c;
for ( ; *p; p++) {
+ if ( ! isprint(*p) && '\t' != *p)
+ return(mdoc_perr(mdoc, line, pos,
+ "invalid characters"));
if ('\\' != *p)
continue;
if ((c = mdoc_isescape(p))) {
@@ -403,7 +407,7 @@ check_text(struct mdoc *mdoc, size_t line, size_t pos, const char *p)
continue;
}
return(mdoc_perr(mdoc, line, pos,
- "invalid escape sequence"));
+ "invalid escape sequence"));
}
return(1);