Reported by Aharon Robbins in <http://sourceware.org/ml/libc-alpha/2012-12/msg00456.html>. * lib/regexec.c (check_node_accept_bytes): Return 0 if the pattern string has a multibyte character here. --- ChangeLog | 6 ++++++ lib/regexec.c | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog index 8c61adb..0c3c7f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2012-12-29 Paul Eggert <egg...@cs.ucla.edu> + regex: check that pattern char is single-byte + Reported by Aharon Robbins in + <http://sourceware.org/ml/libc-alpha/2012-12/msg00456.html>. + * lib/regexec.c (check_node_accept_bytes): + Return 0 if the pattern string has a multibyte character here. + regex: implement rational ranges Reported by Aharon Robbins in <http://sourceware.org/ml/libc-alpha/2012-12/msg00456.html>. diff --git a/lib/regexec.c b/lib/regexec.c index 22e8dd6..b10efb3 100644 --- a/lib/regexec.c +++ b/lib/regexec.c @@ -3858,7 +3858,11 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx, elem_len = re_string_elem_size_at (input, str_idx); if ((elem_len <= 1 && char_len <= 1) || char_len == 0) - return 0; + { + wint_t wc = __btowc (input->mbs[str_idx]); + if (wc < SBC_MAX && wc != WEOF) + return 0; + } if (node->type == COMPLEX_BRACKET) { -- 1.7.11.7