]> git.saurik.com Git - apple/libc.git/commitdiff
Libc-498.1.1.tar.gz mac-os-x-1053 mac-os-x-1054 mac-os-x-1055 v498.1.1
authorApple <opensource@apple.com>
Wed, 5 Mar 2008 05:24:06 +0000 (05:24 +0000)
committerApple <opensource@apple.com>
Wed, 5 Mar 2008 05:24:06 +0000 (05:24 +0000)
gen/NSSystemDirectories.c

index 31ab4090b7a7a985e75365d9c1aacd3ddad051cf..13ac731a4f6656cfdb2309aece9e6646906c3a2e 100644 (file)
@@ -117,11 +117,11 @@ NSSearchPathEnumerationState NSGetNextSearchPathEnumeration(NSSearchPathEnumerat
 
     // Get NEXT_ROOT, if necessary.
     if (domainInfo[curDomain].needsRootPrepended && nextRoot == 0) {
-       nextRoot = getenv("NEXT_ROOT");
+       if (!issetugid() && (nextRoot = getenv("NEXT_ROOT")) != NULL) {
+           nextRoot = strdup(nextRoot);
+       }
         if (nextRoot == NULL) {
             nextRoot = "";
-        } else {
-            strcpy(malloc(strlen(nextRoot) + 1), nextRoot);    // Be safe...
         }
     }