diff options
| author | Richard M. Stallman | 1998-05-06 20:46:35 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-05-06 20:46:35 +0000 |
| commit | 9d99031fcfa519d0efdce52d1b76e058c7ac277c (patch) | |
| tree | eb6efd89e7112f569bbc45b04ad30eec86cfb33a /src | |
| parent | 8bb697c0d6306b1a9c6e3b5864540c9629bfee2b (diff) | |
| download | emacs-9d99031fcfa519d0efdce52d1b76e058c7ac277c.tar.gz emacs-9d99031fcfa519d0efdce52d1b76e058c7ac277c.zip | |
(regex_compile): When checking after exactn
for a repetition operator, don't look beyond end of pattern arg.
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/regex.c b/src/regex.c index bbbfcc9fe54..ed4cfc9d95a 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | 0.12. (Implements POSIX draft P10003.2/D11.2, except for | 2 | 0.12. (Implements POSIX draft P10003.2/D11.2, except for |
| 3 | internationalization features.) | 3 | internationalization features.) |
| 4 | 4 | ||
| 5 | Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc. | 5 | Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc. |
| 6 | 6 | ||
| 7 | This program is free software; you can redistribute it and/or modify | 7 | This program is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by | 8 | it under the terms of the GNU General Public License as published by |
| @@ -2907,14 +2907,14 @@ regex_compile (pattern, size, syntax, bufp) | |||
| 2907 | || *pending_exact >= (1 << BYTEWIDTH) - (p - p1) | 2907 | || *pending_exact >= (1 << BYTEWIDTH) - (p - p1) |
| 2908 | 2908 | ||
| 2909 | /* If followed by a repetition operator. */ | 2909 | /* If followed by a repetition operator. */ |
| 2910 | || *p == '*' || *p == '^' | 2910 | || (p != pend && (*p == '*' || *p == '^')) |
| 2911 | || ((syntax & RE_BK_PLUS_QM) | 2911 | || ((syntax & RE_BK_PLUS_QM) |
| 2912 | ? *p == '\\' && (p[1] == '+' || p[1] == '?') | 2912 | ? p + 1 < pend && *p == '\\' && (p[1] == '+' || p[1] == '?') |
| 2913 | : (*p == '+' || *p == '?')) | 2913 | : p != pend && (*p == '+' || *p == '?')) |
| 2914 | || ((syntax & RE_INTERVALS) | 2914 | || ((syntax & RE_INTERVALS) |
| 2915 | && ((syntax & RE_NO_BK_BRACES) | 2915 | && ((syntax & RE_NO_BK_BRACES) |
| 2916 | ? *p == '{' | 2916 | ? p != pend && *p == '{' |
| 2917 | : (p[0] == '\\' && p[1] == '{')))) | 2917 | : p + 1 < pend && p[0] == '\\' && p[1] == '{'))) |
| 2918 | { | 2918 | { |
| 2919 | /* Start building a new exactn. */ | 2919 | /* Start building a new exactn. */ |
| 2920 | 2920 | ||