This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
intl patches (25)
- From: Bruno Haible <haible at ilog dot fr>
- To: libc-alpha at sources dot redhat dot com
- Date: Thu, 22 Nov 2001 15:01:51 +0100 (CET)
- Subject: intl patches (25)
A slightly stricter check for the 'nplurals' value. The current code, based
on strtoul, accepts numbers starting with a minus sign. Here is a patch to
reject them.
2001-09-22 Bruno Haible <bruno@clisp.org>
* intl/plural-exp.c (EXTRACT_PLURAL_EXPRESSION): Reject numbers that
don't start with a digit; nplurals must be positive.
--- glibc-20011110/intl/plural-exp.c.bak Wed Nov 21 12:35:53 2001
+++ glibc-20011110/intl/plural-exp.c Tue Nov 20 01:35:42 2001
@@ -121,6 +121,8 @@
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