1
Description: Do not crash if regexp is too long for our buffer
2
Author: Ian Jackson <iwj@ubuntu.com>, Jonathan Nieder <jrnieder@gmail.com>
3
Bug-Ubuntu: https://bugs.launchpad.net/bug/23494
4
Bug-Debian: http://bugs.debian.org/391051
13
+ if (p >= string_buff + MIN_SPRINTF - 2)
16
+ "regular expression /%.10s ..."
17
+ " exceeds implementation size limit",
21
switch (scan_code[*p++ = next()])
23
case SC_DIV: /* done */
31
/* now we've got the RE, so compile it */
36
cmp -s reg-awk.out temp$$ || exit
39
+backslashes='\\\\\\\\\\'
40
+backslashes="$backslashes$backslashes$backslashes$backslashes"
41
+backslashes="$backslashes$backslashes$backslashes$backslashes"
42
+backslashes="$backslashes$backslashes$backslashes$backslashes"
43
+( set +e; LC_ALL=C mawk "/a$backslashes/" $dat; test $? -eq 2 ) || exit
45
echo regular expression matching OK
46
#######################################