]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Reject negative nplurals values.
authorBruno Haible <bruno@clisp.org>
Mon, 22 Oct 2001 08:53:25 +0000 (08:53 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 22 Oct 2001 08:53:25 +0000 (08:53 +0000)
intl/ChangeLog
intl/plural-exp.c

index 2e69af0b6e2e8c9ea54ee787ddcac8ef00d955ee..50f3104c5de0f33dffb26b89447d106684d579d8 100644 (file)
@@ -1,3 +1,8 @@
+2001-09-22  Bruno Haible  <haible@clisp.cons.org>
+
+       * plural-exp.c (EXTRACT_PLURAL_EXPRESSION): Reject numbers that don't
+       start with a digit; nplurals must be positive.
+
 2001-10-20  Bruno Haible  <haible@clisp.cons.org>
 
        Assume strchr() exists. (Without it, explodename.c wouldn't link
index bd8c22c51434dd8e3479def83487ebfcd5a4a6e6..06482991bea1f930df864054967e9389693d3df2 100644 (file)
@@ -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