This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]