summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2006-08-30 17:48:47 (GMT)
committerhobbs <hobbs@noemail.net>2006-08-30 17:48:47 (GMT)
commit84b2c1572e86c1631a8c687f1422cefb20cb6da2 (patch)
tree14aba76b3795594b8283cd1dfab48c4a53f8048a /generic
parent909530ec413a159993b3bcdde323408aabfcfc1b (diff)
downloadtcl-84b2c1572e86c1631a8c687f1422cefb20cb6da2.zip
tcl-84b2c1572e86c1631a8c687f1422cefb20cb6da2.tar.gz
tcl-84b2c1572e86c1631a8c687f1422cefb20cb6da2.tar.bz2
* win/tclWinFCmd.c: [Bug 1548263] Added test for NULL return
* generic/tclIOUtil.c: from Tcl_FSGetNormalizedPath which was causing segv's FossilOrigin-Name: bf32b6a16f52c11c4f6bac3a347a958affef497e
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIOUtil.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/generic/tclIOUtil.c b/generic/tclIOUtil.c
index b5cf2ec..7ee2583 100644
--- a/generic/tclIOUtil.c
+++ b/generic/tclIOUtil.c
@@ -17,7 +17,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.30 2006/08/21 14:56:28 dgp Exp $
+ * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.31 2006/08/30 17:48:48 hobbs Exp $
*/
#include "tclInt.h"
@@ -4013,6 +4013,9 @@ NativeCreateNativeRep(pathObjPtr)
/* Make sure the normalized path is set */
validPathObjPtr = Tcl_FSGetNormalizedPath(NULL, pathObjPtr);
+ if (validPathObjPtr == NULL) {
+ return NULL;
+ }
str = Tcl_GetStringFromObj(validPathObjPtr, &len);
#ifdef __WIN32__
@@ -4028,7 +4031,7 @@ NativeCreateNativeRep(pathObjPtr)
#endif
nativePathPtr = ckalloc((unsigned) len);
memcpy((VOID*)nativePathPtr, (VOID*)Tcl_DStringValue(&ds), (size_t) len);
-
+
Tcl_DStringFree(&ds);
return (ClientData)nativePathPtr;
}
@@ -5436,7 +5439,9 @@ Tcl_FSGetTranslatedPath(interp, pathPtr)
retObj = srcFsPathPtr->translatedPathPtr;
}
- Tcl_IncrRefCount(retObj);
+ if (retObj) {
+ Tcl_IncrRefCount(retObj);
+ }
return retObj;
}