chorny/XML-Parser — pull request #4 by tsch (2013-01-30 14:44:59+00:00)
Title: Avoid clobbering PL_na

We used to do SvPV(string, PL_na) in a few places. This is not correct as it
sets the interpreter variable PL_na to the length of the string. Conceptually,
PL_na is just a readability-improving alias for 0. So if anyone else using the
same interpreter then does newSVpv(other_string, PL_na), an invalid read
occurs. The test suite did not catch this because we use newSVpv(other_string,
0) everywhere.

Simply use SvPV_nolen(string) to fix this.

***

I found this via invalid reads showing up in a Gtk3 program; XML_SetBase turned out to be the culprit. I have no idea why this did not show up in other contexts; the same program was running fine with Gtk2, for example. I would think every XS module is affected.