From: Bruno Haible Date: Mon, 22 Oct 2001 08:53:25 +0000 (+0000) Subject: Reject negative nplurals values. X-Git-Tag: v0.11~434 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0039ecacf2d04456dc94342f8f76d4bb5516b943;p=thirdparty%2Fgettext.git Reject negative nplurals values. --- diff --git a/intl/ChangeLog b/intl/ChangeLog index 2e69af0b6..50f3104c5 100644 --- a/intl/ChangeLog +++ b/intl/ChangeLog @@ -1,3 +1,8 @@ +2001-09-22 Bruno Haible + + * plural-exp.c (EXTRACT_PLURAL_EXPRESSION): Reject numbers that don't + start with a digit; nplurals must be positive. + 2001-10-20 Bruno Haible Assume strchr() exists. (Without it, explodename.c wouldn't link diff --git a/intl/plural-exp.c b/intl/plural-exp.c index bd8c22c51..06482991b 100644 --- a/intl/plural-exp.c +++ b/intl/plural-exp.c @@ -112,14 +112,16 @@ EXTRACT_PLURAL_EXPRESSION (nullentry, pluralp, npluralsp) goto no_plural; else { - /* First get the number. */ char *endp; unsigned long int n; struct parse_args args; + /* First get the number. */ nplurals += 9; while (*nplurals != '\0' && isspace ((unsigned char) *nplurals)) ++nplurals; + if (!(*nplurals >= '0' && *nplurals <= '9')) + goto no_plural; #if defined HAVE_STRTOUL || defined _LIBC n = strtoul (nplurals, &endp, 10); #else