From adfc66903cd54922dc5de96d2d2dbce95a67c1b3 Mon Sep 17 00:00:00 2001 From: "wtc%netscape.com" Date: Thu, 10 Sep 1998 21:08:47 +0000 Subject: [PATCH] In CreateMacPathFromUnixPath, return paramErr if unixPath is nil. git-svn-id: svn://10.0.0.236/trunk@9763 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/nsprpub/pr/src/md/mac/macio.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mozilla/nsprpub/pr/src/md/mac/macio.c b/mozilla/nsprpub/pr/src/md/mac/macio.c index f0e393bc14b..ae5aa2ffd3e 100644 --- a/mozilla/nsprpub/pr/src/md/mac/macio.c +++ b/mozilla/nsprpub/pr/src/md/mac/macio.c @@ -1044,6 +1044,12 @@ static OSErr CreateMacPathFromUnixPath(const char *unixPath, char **macPath) 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 ":". @@ -1612,6 +1618,12 @@ static OSErr CreateMacPathFromUnixPath(const char *unixPath, char **macPath) 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 ":".