aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-07-06 18:37:34 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-07-06 18:37:34 +0000
commitccc85730690610c12755680ddc110bf6bde742cf (patch)
treedb401b70eeaf6420ce5551246e27f1b8393f28bb /mandoc.c
parent1fb6260b95b5d63603b18fce1b7f24f1a0db82b3 (diff)
downloadmandoc-ccc85730690610c12755680ddc110bf6bde742cf.tar.gz
mandoc-ccc85730690610c12755680ddc110bf6bde742cf.tar.zst
mandoc-ccc85730690610c12755680ddc110bf6bde742cf.zip
Fix handling of escape sequences taking numeric arguments.
* Repair detection of invalid delimiters. * Discard the invalid delimiter together with the invalid sequence. Note to self: In general, strchr("\0...", c) is a thoroughly bad idea.
Diffstat (limited to 'mandoc.c')
-rw-r--r--mandoc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mandoc.c b/mandoc.c
index 794af306..40e0eae9 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -1,4 +1,4 @@
-/* $Id: mandoc.c,v 1.81 2014/07/01 22:37:15 schwarze Exp $ */
+/* $Id: mandoc.c,v 1.82 2014/07/06 18:37:34 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -200,8 +200,10 @@ mandoc_escape(const char **end, const char **start, int *sz)
case 'v':
/* FALLTHROUGH */
case 'x':
- if (strchr("\0 %&()*+-./0123456789:<=>", **start))
+ if (strchr(" %&()*+-./0123456789:<=>", **start)) {
+ ++*end;
return(ESCAPE_ERROR);
+ }
gly = ESCAPE_IGNORE;
term = **start;
*start = ++*end;