intl patches (25)

Bruno Haible haible@ilog.fr
Tue Nov 13 09:21:00 GMT 2001


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



More information about the Libc-alpha mailing list