diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2014-08-18 09:11:47 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2014-08-18 09:11:47 +0000 |
commit | a85c2bafa990fdb5b501994d2144372b0a789395 (patch) | |
tree | 6519db35d517b758fb45c5ae643f3ccd303cb3d1 /mandoc.c | |
parent | 63484eb541a34de6d744faf8b22686be28597c50 (diff) | |
download | mandoc-a85c2bafa990fdb5b501994d2144372b0a789395.tar.gz |
Fix a corner case where \H<nil> (where <nil> is the \0 character) would
cause mandoc_escape() to read past the end of an allocated string.
Found when a script scanning of all Mac OSX manual accidentally also
scanned binary (gzip'd) files, discussed with schwarze@ on tech@.
Diffstat (limited to 'mandoc.c')
-rw-r--r-- | mandoc.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -199,7 +199,8 @@ mandoc_escape(const char **end, const char **start, int *sz) /* FALLTHROUGH */ case 'x': if (strchr(" %&()*+-./0123456789:<=>", **start)) { - ++*end; + if ('\0' != **start) + ++*end; return(ESCAPE_ERROR); } gly = ESCAPE_IGNORE; |