Skip to content

Commit

Permalink
Merge PR-10827653
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.macosforge.org/repository/darwinbuild/trunk@1022 10a61168-4876-4dac-953b-31e694342555
  • Loading branch information
kvanvechten committed Feb 15, 2012
1 parent 2f92eea commit 9d09167
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Darwin Build Scripts Change History
-----------------------------------
Release 29 [15-Feb-2012]
- darwintrace: posix_spawn may have NULL envp parameter

Release 28.1 [9-Feb-2012]
- darwinup: Don't include actual mach-o binaries in the test suite.

Expand Down
16 changes: 10 additions & 6 deletions darwintrace/darwintrace.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2005-2011 Apple Inc. All rights reserved.
* Copyright (c) 2005-2012 Apple Inc. All rights reserved.
*
* @APPLE_BSD_LICENSE_HEADER_START@
*
Expand Down Expand Up @@ -393,11 +393,13 @@ static char *const *darwintrace_make_environ(char *const envp[]) {
int count = 0;

/* count the environment variables */
while (envp[count] != NULL) {
if (has_prefix(envp[count], DYLD_INSERT_LIBRARIES)) {
libs = envp[count] + strlen(DYLD_INSERT_LIBRARIES);
if (envp) {
while (envp[count] != NULL) {
if (has_prefix(envp[count], DYLD_INSERT_LIBRARIES)) {
libs = envp[count] + strlen(DYLD_INSERT_LIBRARIES);
}
++count;
}
++count;
}

/* allocate size of envp with enough space for three more values and NULL */
Expand Down Expand Up @@ -435,7 +437,9 @@ static char *const *darwintrace_make_environ(char *const envp[]) {
}
++i;

memcpy(&result[i], envp, count * sizeof(char *));
if (envp) {
memcpy(&result[i], envp, count * sizeof(char *));
}

while (result[i] != NULL) {
if (has_prefix(result[i], DARWINTRACE_IGNORE_ROOTS) ||
Expand Down

0 comments on commit 9d09167

Please sign in to comment.