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.
This commit is contained in:
Ulrich Drepper 2001-06-10 06:51:02 +00:00
parent 582e776ffc
commit e10a9ebaa6
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,8 @@
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.
2001-06-06 Roland McGrath <roland@frob.com>
* sysdeps/mach/hurd/getsockopt.c: Fix handling of returned buffer size.

View file

@ -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;