Skip to content

Commit

Permalink
Version 360.18
Browse files Browse the repository at this point in the history
  • Loading branch information
Apple Open Source authored and opensource-apple committed Dec 21, 2015
1 parent 247c711 commit 3f928f3
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/dyld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1618,12 +1618,15 @@ static void checkLoadCommandEnvironmentVariables()
if ( strncmp(&equals[-5], "_PATH", 5) == 0 ) {
const char* value = &equals[1];
const size_t keyLen = equals-keyEqualsValue;
char key[keyLen+1];
strncpy(key, keyEqualsValue, keyLen);
key[keyLen] = '\0';
//dyld::log("processing: %s\n", keyEqualsValue);
//dyld::log("mainExecutableDir: %s\n", mainExecutableDir);
processDyldEnvironmentVariable(key, value, mainExecutableDir);
// <rdar://problem/22799635> don't let malformed load command overflow stack
if ( keyLen < 40 ) {
char key[keyLen+1];
strncpy(key, keyEqualsValue, keyLen);
key[keyLen] = '\0';
//dyld::log("processing: %s\n", keyEqualsValue);
//dyld::log("mainExecutableDir: %s\n", mainExecutableDir);
processDyldEnvironmentVariable(key, value, mainExecutableDir);
}
}
}
}
Expand Down

0 comments on commit 3f928f3

Please sign in to comment.