about summary refs log tree commit diff
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
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.
-rw-r--r--ChangeLog5
-rw-r--r--posix/regex.c5
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  <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.
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;