]> Savannah Git Hosting - gnulib.git/commit
regex: fix longstanding backref match bug
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 6 Feb 2021 01:08:10 +0000 (17:08 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 6 Feb 2021 01:25:00 +0000 (17:25 -0800)
commit70b673eb768eb7288639cbbe4642c2912b7d204e
treec36664480e6d05be460346e5fc1abbcd2fee8eb9
parentf5596242f91109b393919653d091bbeecc4b0a55
regex: fix longstanding backref match bug

This fixes a longstanding glibc bug concerning backreferences
<https://sourceware.org/11053> (2009-12-04).
* lib/regexec.c (proceed_next_node, push_fail_stack)
(pop_fail_stack): Push and pop the previous registers
as well as the current ones.  All callers changed.
(set_regs): Also pop if CUR_NODE has already been checked,
so that it does not get added as a duplicate set entry.
(update_regs): Fix comment location.
* tests/test-regex.c (tests): New constant.
(bug_regex11): New test function.
(main): Bump alarm value.  Call new test function.
ChangeLog
lib/regexec.c
tests/test-regex.c