diff options
| author | dgp <dgp@users.sourceforge.net> | 2014-05-16 14:47:59 (GMT) | 
|---|---|---|
| committer | dgp <dgp@users.sourceforge.net> | 2014-05-16 14:47:59 (GMT) | 
| commit | 158ab27221e5fc2a60bc40c390bf95a9fd6c3c7f (patch) | |
| tree | f40ad72828d9fa3a5dc4a59ede2dee8daed72706 /unix/tclUnixFile.c | |
| parent | edb5d20cbf5d63d6408eace75acf9eeacf907a9e (diff) | |
| parent | b4ca74a5629b1e6ef5e8af2fc3db7f04cb3cbef9 (diff) | |
| download | tcl-158ab27221e5fc2a60bc40c390bf95a9fd6c3c7f.zip tcl-158ab27221e5fc2a60bc40c390bf95a9fd6c3c7f.tar.gz tcl-158ab27221e5fc2a60bc40c390bf95a9fd6c3c7f.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); | 
