diff options
author | dgp <dgp@users.sourceforge.net> | 2014-05-16 15:05:08 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2014-05-16 15:05:08 (GMT) |
commit | e2f62bb184b56cd2c6b21548153aee71b8d719a8 (patch) | |
tree | 77cdd0683d48082b253c28221385704f4d569ea8 /unix/tclUnixFile.c | |
parent | 40646ad79cd332a232c9d5afea6f879222e9ccb9 (diff) | |
parent | 42ba1ff27ede658e6f4b9d80c5c6c2734dcb39bf (diff) | |
download | tcl-e2f62bb184b56cd2c6b21548153aee71b8d719a8.zip tcl-e2f62bb184b56cd2c6b21548153aee71b8d719a8.tar.gz tcl-e2f62bb184b56cd2c6b21548153aee71b8d719a8.tar.bz2 |
merge 8.5
Diffstat (limited to 'unix/tclUnixFile.c')
-rw-r--r-- | unix/tclUnixFile.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/unix/tclUnixFile.c b/unix/tclUnixFile.c index 29f1aba..c5f75a7 100644 --- a/unix/tclUnixFile.c +++ b/unix/tclUnixFile.c @@ -1111,6 +1111,12 @@ TclNativeCreateNativeRep( str = Tcl_GetStringFromObj(validPathPtr, &len); Tcl_UtfToExternalDString(NULL, str, len, &ds); len = Tcl_DStringLength(&ds) + sizeof(char); + if (strlen(Tcl_DStringValue(&ds)) < len - sizeof(char)) { + /* See bug [3118489]: NUL in filenames */ + Tcl_DecrRefCount(validPathPtr); + Tcl_DStringFree(&ds); + return NULL; + } Tcl_DecrRefCount(validPathPtr); nativePathPtr = ckalloc((unsigned) len); memcpy((void*)nativePathPtr, (void*)Tcl_DStringValue(&ds), (size_t) len); |