summaryrefslogtreecommitdiff
path: root/warnings.h
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 /warnings.h
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 'warnings.h')
-rw-r--r--warnings.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/warnings.h b/warnings.h
index 5c40d5c398..f5ff791ccd 100644
--- a/warnings.h
+++ b/warnings.h
@@ -95,9 +95,13 @@
#define WARN_EXPERIMENTAL__REGEX_SETS 54
#define WARN_EXPERIMENTAL__SMARTMATCH 55
-#define WARNsize 14
-#define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125\125\125"
-#define WARN_NONEstring "\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
+/* Warnings Categories added in Perl 5.019 */
+
+#define WARN_SYSCALLS 56
+
+#define WARNsize 15
+#define WARN_ALLstring "\125\125\125\125\125\125\125\125\125\125\125\125\125\125\125"
+#define WARN_NONEstring "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
#define isLEXWARN_on (PL_curcop->cop_warnings != pWARN_STD)
#define isLEXWARN_off (PL_curcop->cop_warnings == pWARN_STD)