From 0a7506c9bdc0d0d560d4b9c8a3d1089f5db425b9 Mon Sep 17 00:00:00 2001 From: Apple Date: Wed, 5 Mar 2008 05:24:06 +0000 Subject: [PATCH] Libc-498.1.1.tar.gz --- gen/NSSystemDirectories.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gen/NSSystemDirectories.c b/gen/NSSystemDirectories.c index 31ab409..13ac731 100644 --- a/gen/NSSystemDirectories.c +++ b/gen/NSSystemDirectories.c @@ -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... } } -- 2.47.2