mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07: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
dc39cb9054
commit
1db5266dde
@ -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