In CreateMacPathFromUnixPath, return paramErr if unixPath is nil.
authorwtc%netscape.com
Thu, 10 Sep 1998 21:08:47 +0000
changeset 234 6db2ae39ed9d493a430a8d0d40de27052ab29618
parent 233 dea4fc333bb13b532f0c49cc5b2fb3eef0e7c58b
child 238 8f0dd639c46afa7af853dd531712a8ce2abc65f1
push idunknown
push userunknown
push dateunknown
In CreateMacPathFromUnixPath, return paramErr if unixPath is nil.
pr/src/md/mac/macio.c
--- a/pr/src/md/mac/macio.c
+++ b/pr/src/md/mac/macio.c
@@ -1039,16 +1039,22 @@ static OSErr CreateMacPathFromUnixPath(c
 	//
 	// It does not do any special directory translation; use ConvertUnixPathToMacPath
 	// for that.
 	
 	const char	*src;
 	char		*tgt;
 	OSErr		err = noErr;
 
+	PR_ASSERT(unixPath != nil);
+	if (nil == unixPath) {
+		err = paramErr;
+		goto exit;
+	}
+
 	// If unixPath is a zero-length string, we copy ":" into
 	// macPath, so we need a minimum of two bytes to handle
 	// the case of ":". 
 	*macPath = malloc(strlen(unixPath) + 2);	// Will be enough extra space.
 	require_action (*macPath != NULL, exit, err = memFullErr;);
 
 	src = unixPath;
 	tgt = *macPath;
@@ -1607,16 +1613,22 @@ static OSErr CreateMacPathFromUnixPath(c
 	//
 	// It does not do any special directory translation; use ConvertUnixPathToMacPath
 	// for that.
 	
 	const char	*src;
 	char		*tgt;
 	OSErr		err = noErr;
 
+	PR_ASSERT(unixPath != nil);
+	if (nil == unixPath) {
+		err = paramErr;
+		goto exit;
+	}
+
 	// If unixPath is a zero-length string, we copy ":" into
 	// macPath, so we need a minimum of two bytes to handle
 	// the case of ":". 
 	*macPath = malloc(strlen(unixPath) + 2);	// Will be enough extra space.
 	require_action (*macPath != NULL, exit, err = memFullErr;);
 
 	src = unixPath;
 	tgt = *macPath;