]> Savannah Git Hosting - gnulib.git/commit
regex: avoid undefined behavior
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 6 Feb 2021 00:35:45 +0000 (16:35 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 6 Feb 2021 01:24:59 +0000 (17:24 -0800)
commit37f2bbbe8b9ea0a6659a60ab05602bb2742eebe5
tree117e2b78797bf3b0a5996703713d7b203ad1b474
parent607c71a6f5b705e6545b067b64e089280c68367b
regex: avoid undefined behavior

* lib/regexec.c (pop_fail_stack): If the stack is empty, return -1
instead of indulging in undefined behavior.  This simplifies
callers, and avoids undefined behavior in some cases (see glibc
bug 11053, though this change does not fix that overall bug).
ChangeLog
lib/regexec.c