Program received signal SIGSEGV, Segmentation fault.
0x
00000a9bf44b686a in XS_Sub__Name_subname (cv=Variable "cv" is not available.
) at Name.xs:72
72 else if (*s && s[-1] == '\'') {
(gdb) print s
$1 = 0x
a9c6d507000 "test::SOME_y_STASH::SOME_y_NAME"
With OpenBSD malloc randomisation the storage for nameptr is sometimes
at the beginning of the page. Then accessing s[-1] with s == nameptr
is fatal.
croak("Not a subroutine reference");
for (s = nameptr; s <= nameptr + namelen; s++) {
- if (*s == ':' && s[-1] == ':') {
+ if (s > nameptr && *s == ':' && s[-1] == ':') {
end = s - 1;
begin = ++s;
if (seen_quote)
need_subst++;
}
- else if (*s && s[-1] == '\'') {
+ else if (s > nameptr && *s != '\0' && s[-1] == '\'') {
end = s - 1;
begin = s;
if (seen_quote++)