From e8f7de4bed29ada032b34d1352a0cc6f96b7fc5c Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Mon, 3 Dec 2007 10:45:44 +0000 Subject: [PATCH] zic(8) should exit the loop when the end of the string is reached due to the call to error(). The problem found by doing fuzz testing. MFC after: 3 days --- usr.sbin/zic/zic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/zic/zic.c b/usr.sbin/zic/zic.c index 4e235b00bb42..10d79a898a2c 100644 --- a/usr.sbin/zic/zic.c +++ b/usr.sbin/zic/zic.c @@ -1990,7 +1990,10 @@ register char * cp; else while ((*dp = *cp++) != '"') if (*dp != '\0') ++dp; - else error(_("odd number of quotation marks")); + else { + error(_("odd number of quotation marks")); + exit(EXIT_FAILURE); + } } while (*cp != '\0' && *cp != '#' && (!isascii(*cp) || !isspace((unsigned char) *cp))); if (isascii(*cp) && isspace((unsigned char) *cp))