regex crash
Andreas Schwab
schwab@suse.de
Fri Jun 8 07:10:00 GMT 2001
This fixes a crash when calling regexec with the empty string and the
pattern '\<'.
2001-06-08 Andreas Schwab <schwab@suse.de>
* posix/regex.c (re_match_2_internal) [case wordbeg, wordend]:
Don't dereference at end of string.
--- posix/regex.c.~1.97.~ Tue May 15 13:30:03 2001
+++ posix/regex.c Fri Jun 8 16:03:51 2001
@@ -7094,14 +7094,15 @@
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;
--
Andreas Schwab "And now for something
SuSE Labs completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
More information about the Libc-hacker
mailing list