From e10a9ebaa658d1b9e467556053cf7634f8d1b9fd Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 10 Jun 2001 06:51:02 +0000 Subject: [PATCH] Update. 2001-06-08 Andreas Schwab * posix/regex.c (re_match_2_internal) [case wordbeg, wordend]: Don't dereference at end of string. --- ChangeLog | 5 +++++ posix/regex.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4eb9f1ecec..5fa72015d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-06-08 Andreas Schwab + + * posix/regex.c (re_match_2_internal) [case wordbeg, wordend]: + Don't dereference at end of string. + 2001-06-06 Roland McGrath * sysdeps/mach/hurd/getsockopt.c: Fix handling of returned buffer size. diff --git a/posix/regex.c b/posix/regex.c index ca4645945e..086de08084 100644 --- a/posix/regex.c +++ b/posix/regex.c @@ -7094,14 +7094,15 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) case wordbeg: DEBUG_PRINT1 ("EXECUTING wordbeg.\n"); - if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1))) + if (!AT_STRINGS_END (d) && WORDCHAR_P (d) + && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1))) break; goto fail; case wordend: DEBUG_PRINT1 ("EXECUTING wordend.\n"); if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1) - && (!WORDCHAR_P (d) || AT_STRINGS_END (d))) + && (AT_STRINGS_END (d) || !WORDCHAR_P (d))) break; goto fail;