Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix harmless invalid read in Perl_re_compile()
[perl #2460] described a case where electric fence reported an invalid read. This could be reproduced under valgrind with blead and -e'/x/', but only on a non-debugging build. This was because it was checking for certain pairs of nodes (e.g. BOL + END) and wasn't allowing for EXACT nodes, which have the string at the next node position when using a naive NEXTOPER(first). In the non-debugging build, the nodes aren't initialised to zero, and a 1-char EXACT node isn't long enough to spill into the type field of the "next node". Fix this by only using NEXTOPER(first) when we know the first node is kosher.
- Loading branch information