From b4a8d2a766c34971890c00827d75474e43c68c3d Mon Sep 17 00:00:00 2001 From: coldstore Date: Fri, 13 Oct 2006 04:53:51 +0000 Subject: win/tclWinFile.c: corrected erroneous attempt to protect against NULL return from Tcl_FSGetNormalizedPath per Bug 1548263 causing Bug 1575837. --- win/tclWinFile.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/win/tclWinFile.c b/win/tclWinFile.c index 1e84315..41e1733 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.88 2006/10/01 21:30:04 patthoyts Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.89 2006/10/13 04:53:51 coldstore Exp $ */ /* #define _WIN32_WINNT 0x0500 */ @@ -2486,13 +2486,17 @@ TclpObjLink( int linkAction) { if (toPtr != NULL) { - toPtr = Tcl_FSGetNormalizedPath(NULL, toPtr); - } - if (toPtr != NULL) { int res; - TCHAR *LinkTarget = (TCHAR *) Tcl_FSGetNativePath(toPtr); + TCHAR *LinkTarget; TCHAR *LinkSource = (TCHAR *) Tcl_FSGetNativePath(pathPtr); + toPtr = Tcl_FSGetNormalizedPath(NULL, toPtr); + if (toPtr == NULL) { + return NULL; + } + + LinkTarget = (TCHAR *) Tcl_FSGetNativePath(toPtr); + if (LinkSource == NULL || LinkTarget == NULL) { return NULL; } -- cgit v0.12