+2021-06-22 Egor Ignatov <egori@altlinux.org> (tiny change)
+
+ regex: fix undefined behavior
+ Problem reported by Paul Eggert in:
+ https://lists.gnu.org/r/bug-gnulib/2021-06/msg00115.html
+ * lib/regexec.c (proceed_next_node):
+ Don’t insert already-inserted node.
+
2021-06-21 Eric Blake <eblake@redhat.com>
sigsegv, sigsegv-tests: Assign my contributions to the FSF.
are not used. That comment was copied along with tests from glibc
where some of these tests are commented out.
-2021-06-06 Egor Ignatov <egori@altlinux.org>
+2021-06-06 Egor Ignatov <egori@altlinux.org> (tiny change)
* lib/regexec.c (set_regs): Pop if CUR_NODE has already been checked
only when we have a fail stack.
{
re_node_set *cur_nodes = &mctx->state_log[*pidx]->nodes;
re_node_set *edests = &dfa->edests[node];
- bool ok = re_node_set_insert (eps_via_nodes, node);
- if (__glibc_unlikely (! ok))
- return -2;
+
+ if (! re_node_set_contains (eps_via_nodes, node))
+ {
+ bool ok = re_node_set_insert (eps_via_nodes, node);
+ if (__glibc_unlikely (! ok))
+ return -2;
+ }
/* Pick a valid destination, or return -1 if none is found. */
Idx dest_node = -1;