diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-09-21 13:16:41 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-09-21 13:16:41 +0300 |
commit | b1d75cf79c57071f55fcb6100a07d8cd706e890f (patch) | |
tree | a96e04d38fb68f7ee1dee2bd10f79f778239cf03 /re.c | |
parent | a7c32b55995136013af2bff2a0fe4d6c69678cb7 (diff) | |
parent | 5e4861ab4c41b6e000dc1f66225486330b5e5a2d (diff) | |
download | egawk-b1d75cf79c57071f55fcb6100a07d8cd706e890f.tar.gz egawk-b1d75cf79c57071f55fcb6100a07d8cd706e890f.tar.bz2 egawk-b1d75cf79c57071f55fcb6100a07d8cd706e890f.zip |
Merge branch 'gawk-4.2-stable'
Diffstat (limited to 're.c')
-rw-r--r-- | re.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -112,6 +112,12 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) (*src == '\\')) { c = *++src; switch (c) { + case '\0': /* \\ before \0, either dynamic data or real end of string */ + if (src >= s + len) + *dest++ = '\\'; // at end of string, will fatal below + else + fatal(_("invalid NUL byte in dynamic regexp")); + break; case 'a': case 'b': case 'f': @@ -241,7 +247,7 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal) error("%s: /%s/", rerr, buf); return NULL; } - fatal("%s: /%s/", rerr, buf); + fatal("invalid regexp: %s: /%s/", rerr, buf); } /* gack. this must be done *after* re_compile_pattern */ |