summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%netscape.com <devnull@localhost>1998-09-10 21:08:47 +0000
committerwtc%netscape.com <devnull@localhost>1998-09-10 21:08:47 +0000
commit28838a842564a2ef5d16fe8b9a4dca7fbccda1cc (patch)
tree521355ef8473bc98be3c83f20465409f7d4b4114
parent9053d23f0bf4d03b5bc80b2ffe59bf1e4dc53825 (diff)
downloadnspr-hg-28838a842564a2ef5d16fe8b9a4dca7fbccda1cc.tar.gz
In CreateMacPathFromUnixPath, return paramErr if unixPath is nil.
-rw-r--r--pr/src/md/mac/macio.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pr/src/md/mac/macio.c b/pr/src/md/mac/macio.c
index f0e393bc..ae5aa2ff 100644
--- a/pr/src/md/mac/macio.c
+++ b/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 ":".