summaryrefslogtreecommitdiffstats
path: root/win/tclWinFile.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/tclWinFile.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/tclWinFile.c')
-rw-r--r--win/tclWinFile.c16
1 files changed, 10 insertions, 6 deletions
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);
}