aboutsummaryrefslogtreecommitdiff
path: root/posix/regex.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-11-19 18:39:58 +0000
committerUlrich Drepper <drepper@redhat.com>1998-11-19 18:39:58 +0000
commitbece5ca7c19138807a8ddb6d1a9c351b47fc5f99 (patch)
tree72d7b54a4c569a2f1e7d395f7450358811499030 /posix/regex.c
parent50463d27cdd5b7a8dd7401ca4850ae3871b9aa78 (diff)
downloadglibc-bece5ca7c19138807a8ddb6d1a9c351b47fc5f99.zip
glibc-bece5ca7c19138807a8ddb6d1a9c351b47fc5f99.tar.gz
glibc-bece5ca7c19138807a8ddb6d1a9c351b47fc5f99.tar.bz2
Update.
1998-11-19 Ulrich Drepper <drepper@cygnus.com> * posix/regex.c (regex_compile): Handle extra long class names correctly.
Diffstat (limited to 'posix/regex.c')
-rw-r--r--posix/regex.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/posix/regex.c b/posix/regex.c
index 5f8e38c..ba01f73 100644
--- a/posix/regex.c
+++ b/posix/regex.c
@@ -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';