From ccc85730690610c12755680ddc110bf6bde742cf Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 6 Jul 2014 18:37:34 +0000 Subject: 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. --- mandoc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mandoc.c') 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 * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -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; -- cgit v1.2.3-56-ge451