diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-02-24 13:46:54 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-02-24 13:46:54 +0000 |
commit | 38fefdf005d8237391f4aabfb145c4a96d930b8b (patch) | |
tree | 3140d1ac71c9d4d0d8ed643bc9937302d4cf9379 /validate.c | |
parent | c8bf126a0b893c247fa4ec7b271fa51308fe257f (diff) | |
download | mandoc-38fefdf005d8237391f4aabfb145c4a96d930b8b.tar.gz |
Character-encoding checked for all text (arguments/values).
Diffstat (limited to 'validate.c')
-rw-r--r-- | validate.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |