mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 22:32:46 +00:00
Bug 1079655: Ensure that the path used to load XPCOM can be sanitized on OSX 10.10. r=spohl
This commit is contained in:
parent
8224b00da3
commit
9c90999dc8
@ -56,9 +56,8 @@ private:
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
UInt8 tempBuffer[MAXPATHLEN];
|
||||
nsresult rv;
|
||||
if (CFURLGetFileSystemRepresentation(executableURL, false, tempBuffer,
|
||||
if (CFURLGetFileSystemRepresentation(executableURL, false, (UInt8*)aResult,
|
||||
MAXPATHLEN)) {
|
||||
rv = NS_OK;
|
||||
} else {
|
||||
@ -69,11 +68,11 @@ private:
|
||||
// for example.
|
||||
size_t readPos = 0;
|
||||
size_t writePos = 0;
|
||||
while (tempBuffer[readPos] != '\0') {
|
||||
if (tempBuffer[readPos] == '.' && tempBuffer[readPos + 1] == '/') {
|
||||
while (aResult[readPos] != '\0') {
|
||||
if (aResult[readPos] == '.' && aResult[readPos + 1] == '/') {
|
||||
readPos += 2;
|
||||
}
|
||||
aResult[writePos] = tempBuffer[readPos];
|
||||
aResult[writePos] = aResult[readPos];
|
||||
readPos++;
|
||||
writePos++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user