In order to make sure we find embedded NULs early enough, before
the directories in @INC have been through library calls that use C
strings, check each directory in pp_require before concatenating
a filename onto it.
dirlen = 0;
}
+ if (!IS_SAFE_SYSCALL(dir, dirlen, "@INC entry", "require"))
+ continue;
#ifdef VMS
if (((unixdirbuf = SvPVX(sv_2mortal(newSVpv("", VMS_MAXRSS-1)))) == NULL)
|| ((unixdir = tounixpath(dir, unixdirbuf)) == NULL))
local @INC = @INC;
unshift @INC, "lib\0invalid";
eval { require "unknown.pm" };
- like $WARN, qr{^Invalid \\0 character in pathname for require: lib\\0invalid/unknown\.pm at }, 'nul warning';
+ like $WARN, qr{^Invalid \\0 character in \@INC entry for require: lib\\0invalid at }, 'nul warning';
}
eval "require strict\0::invalid;";
like $@, qr/^syntax error at \(eval \d+\) line 1/, 'parse error with \0 in barewords module names';