tags 391051 + patch stop Hi
attached is an updated patch for the new quilt packaging, also merging the fix and test case from: http://anonscm.debian.org/gitweb/?p=collab-maint/mawk.git;a=commitdiff;h=e2e6d7ad490a7b19c562af5874a08a4168382b57 Note that the above commit is on top of a newer version of mawk merged into that git repo, but not actually uploaded to Debian; the packaging since moved to a bzr branch at: nosmart+http://bzr.debian.org/bzr/users/vorlon/mawk/trunk/ Cheers, -- Loïc Minier
Author: Ian Jackson <i...@ubuntu.com>, Jonathan Nieder <jrnie...@gmail.com> Description: Do not crash if regexp is too long for our buffer; LP #23494 --- a/scan.c +++ b/scan.c @@ -1033,6 +1033,15 @@ STRING *sval ; while (1) + { + if (p >= string_buff + SPRINTF_SZ - 2) + { + compile_error( + "regular expression /%.10s ..." + " exceeds implementation size limit", + string_buff) ; + mawk_exit(2) ; + } switch (scan_code[*p++ = next()]) { case SC_DIV: /* done */ @@ -1070,6 +1079,7 @@ } break ; } + } out: /* now we've got the RE, so compile it */ --- a/test/mawktest +++ b/test/mawktest @@ -35,6 +35,13 @@ cmp -s reg-awk.out temp$$ || exit +# 640 backslashes +backslashes='\\\\\\\\\\' +backslashes="$backslashes$backslashes$backslashes$backslashes" +backslashes="$backslashes$backslashes$backslashes$backslashes" +backslashes="$backslashes$backslashes$backslashes$backslashes" +( set +e; LC_ALL=C $PROG "/a$backslashes/" $dat; test $? -eq 2 ) || exit + echo regular expression matching OK #######################################