diff options
Diffstat (limited to 'win')
-rw-r--r-- | win/tclWinFCmd.c | 11 | ||||
-rw-r--r-- | win/tclWinFile.c | 16 |
2 files changed, 19 insertions, 8 deletions
diff --git a/win/tclWinFCmd.c b/win/tclWinFCmd.c index 3d95de9..c940620 100644 --- a/win/tclWinFCmd.c +++ b/win/tclWinFCmd.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFCmd.c,v 1.51 2005/12/13 22:43:18 kennykb Exp $ + * RCS: @(#) $Id: tclWinFCmd.c,v 1.52 2006/08/29 00:36:57 coldstore Exp $ */ #include "tclWinInt.h" @@ -925,8 +925,12 @@ TclpObjCopyDirectory( int ret; normSrcPtr = Tcl_FSGetNormalizedPath(NULL,srcPathPtr); - Tcl_WinUtfToTChar(Tcl_GetString(normSrcPtr), -1, &srcString); normDestPtr = Tcl_FSGetNormalizedPath(NULL,destPathPtr); + if ((normSrcPtr == NULL) || (normDestPtr == NULL)) { + return TCL_ERROR; + } + + Tcl_WinUtfToTChar(Tcl_GetString(normSrcPtr), -1, &srcString); Tcl_WinUtfToTChar(Tcl_GetString(normDestPtr), -1, &dstString); ret = TraverseWinTree(TraversalCopy, &srcString, &dstString, &ds); @@ -996,6 +1000,9 @@ TclpObjRemoveDirectory( Tcl_DString native; normPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr); + if (normPtr == NULL) { + return TCL_ERROR; + } Tcl_WinUtfToTChar(Tcl_GetString(normPtr), -1, &native); ret = DoRemoveDirectory(&native, recursive, &ds); Tcl_DStringFree(&native); diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 196c7ac..03ccf9d 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFile.c,v 1.85 2006/03/14 19:34:30 vincentdarley Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.86 2006/08/29 00:36:57 coldstore Exp $ */ /* #define _WIN32_WINNT 0x0500 */ @@ -2483,13 +2483,11 @@ TclpObjLink( int linkAction) { if (toPtr != NULL) { + toPtr = Tcl_FSGetNormalizedPath(NULL, toPtr); + } + if (toPtr != NULL) { int res; -#if 0 TCHAR *LinkTarget = (TCHAR *) Tcl_FSGetNativePath(toPtr); -#else - TCHAR *LinkTarget = (TCHAR *) Tcl_FSGetNativePath( - Tcl_FSGetNormalizedPath(NULL, toPtr)); -#endif TCHAR *LinkSource = (TCHAR *) Tcl_FSGetNativePath(pathPtr); if (LinkSource == NULL || LinkTarget == NULL) { @@ -3256,12 +3254,18 @@ TclNativeCreateNativeRep( */ validPathPtr = Tcl_FSGetTranslatedPath(NULL, pathPtr); + if (validPathPtr == NULL) { + return NULL; + } } else { /* * Make sure the normalized path is set. */ validPathPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr); + if (validPathPtr == NULL) { + return NULL; + } Tcl_IncrRefCount(validPathPtr); } |