Don't access pointers to freed storage in regex.c
commitb7f3a3055c92010afde318c1108b02e4424a3bac
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Nov 2016 08:19:08 +0000 (26 00:19 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 26 Nov 2016 08:20:26 +0000 (26 00:20 -0800)
tree87c216fe495dc9fb716a5c05759911b746a29657
parentcaec5c06caa854a5e9d2001bd8ef7199a0b7540c
Don't access pointers to freed storage in regex.c

Remove __BOUNDED_POINTERS__ code, which does not work with
-fcheck-pointer-bound and which has undefined behavior anyway.
Problem found when trying to port to gcc -fcheck-pointer-bounds.
(This code was removed from glibc and gnulib regex.c many years ago.)
* src/regex.c (ELSE_EXTEND_BUFFER_HIGH_BOUND): Remove.
(EXTEND_BUFFER): Use a more-portable approach that avoids
undefined behavior due to inspecting pointers to freed storage.
src/regex.c