summaryrefslogtreecommitdiff
path: root/t/op/caller.t
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2013-08-26 11:26:19 +1000
committerTony Cook <tony@develop-help.com>2013-08-26 14:06:16 +1000
commitc8028aa68dedb3c7683abb0bcf0fdba782a1190e (patch)
tree0c1acb4263f2d3d1b08e2e42d1ad18b2686617d8 /t/op/caller.t
parent5f7c1602dfa694a4a6761e9e4fc077ce794f7ff0 (diff)
downloadperl-c8028aa68dedb3c7683abb0bcf0fdba782a1190e.tar.gz
[perl #117265] safesyscalls: check embedded nul in syscall args
Check for the nul char in pathnames and string arguments to syscalls, return undef and set errno to ENOENT. Added to the io warnings category syscalls. Strings with embedded \0 chars were prev. ignored in the syscall but kept in perl. The hidden payloads in these invalid string args may cause unnoticed security problems, as they are hard to detect, ignored by the syscalls but kept around in perl PVs. Allow an ending \0 though, as several modules add a \0 to such strings without adjusting the length. This is based on a change originally by Reini Urban, but pretty much all of the code has been replaced.
Diffstat (limited to 't/op/caller.t')
-rw-r--r--t/op/caller.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/op/caller.t b/t/op/caller.t
index c37a6edb06..09728d3ec1 100644
--- a/t/op/caller.t
+++ b/t/op/caller.t
@@ -111,8 +111,8 @@ sub testwarn {
# The repetition number must be set to the value of $BYTES in
# lib/warnings.pm
- BEGIN { check_bits( ${^WARNING_BITS}, "\0" x 14, 'all bits off via "no warnings"' ) }
- testwarn("\0" x 14, 'no bits');
+ BEGIN { check_bits( ${^WARNING_BITS}, "\0" x 15, 'all bits off via "no warnings"' ) }
+ testwarn("\0" x 15, 'no bits');
use warnings;
BEGIN { check_bits( ${^WARNING_BITS}, $default,