summaryrefslogtreecommitdiffstats
path: root/win/tclWinFCmd.c
diff options
context:
space:
mode:
authorcoldstore <coldstore>2006-08-29 00:36:57 (GMT)
committercoldstore <coldstore>2006-08-29 00:36:57 (GMT)
commit4ddcec561c505418f8a373d83ac40a7c31782b15 (patch)
treefbb2d67db8ec91bfa4da2a93652e5717dcaf4984 /win/tclWinFCmd.c
parentc247e59a168cf578e7dad192eb8a2a8c5f11ab64 (diff)
downloadtcl-4ddcec561c505418f8a373d83ac40a7c31782b15.zip
tcl-4ddcec561c505418f8a373d83ac40a7c31782b15.tar.gz
tcl-4ddcec561c505418f8a373d83ac40a7c31782b15.tar.bz2
fixed [ 1548263 ] NULL return from Tcl_FSGetNormalizedPath segv
Diffstat (limited to 'win/tclWinFCmd.c')
-rw-r--r--win/tclWinFCmd.c11
1 files changed, 9 insertions, 2 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);