about summary refs log tree commit diff
path: root/posix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-06-10 06:51:02 +0000
committerUlrich Drepper <drepper@redhat.com>2001-06-10 06:51:02 +0000
commite10a9ebaa658d1b9e467556053cf7634f8d1b9fd (patch)
tree545f329449bf6afdcc2bc7cb9459860a5200fb9d /posix
parent582e776ffcec1ea90a8961f498e4d5014af7e7dc (diff)
downloadglibc-e10a9ebaa658d1b9e467556053cf7634f8d1b9fd.tar.gz
glibc-e10a9ebaa658d1b9e467556053cf7634f8d1b9fd.tar.xz
glibc-e10a9ebaa658d1b9e467556053cf7634f8d1b9fd.zip
Update.
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.
Diffstat (limited to 'posix')
-rw-r--r--posix/regex.c5
1 files changed, 3 insertions, 2 deletions
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;