Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 19 Nov 1998 18:39:58 +0000 (18:39 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 19 Nov 1998 18:39:58 +0000 (18:39 +0000)
1998-11-19  Ulrich Drepper  <drepper@cygnus.com>

* posix/regex.c (regex_compile): Handle extra long class names
correctly.

ChangeLog
posix/regex.c

index f241c1f..feea31d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1998-11-19  Ulrich Drepper  <drepper@cygnus.com>
+
+       * posix/regex.c (regex_compile): Handle extra long class names
+       correctly.
+
 1998-11-19  Geoff Keating  <geoffk@ozemail.com.au>
 
        * elf/rtld.c (_dl_start): Handle weak undefined symbols in ld.so
index 5f8e38c..ba01f73 100644 (file)
@@ -2210,10 +2210,13 @@ regex_compile (pattern, size, syntax, bufp)
                     for (;;)
                       {
                         PATFETCH (c);
-                        if ((c == ':' && *p == ']') || p == pend
-                            || c1 == CHAR_CLASS_MAX_LENGTH)
+                        if ((c == ':' && *p == ']') || p == pend)
                           break;
-                        str[c1++] = c;
+                       if (c1 < CHAR_CLASS_MAX_LENGTH)
+                         str[c1++] = c;
+                       else
+                         /* This is in any case an invalid class name.  */
+                         str[0] = '\0';
                       }
                     str[c1] = '\0';