зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1595470 - Prevent EnsureCorrectPermissions from making faulty assumptions about childBuffer r=rstrong
Differential Revision: https://phabricator.services.mozilla.com/D52604 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
d34efa221b
Коммит
99edf9e247
|
@ -1510,12 +1510,6 @@ static HRESULT EnsureCorrectPermissions(SimpleAutoString& path,
|
||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
SimpleAutoString childBuffer;
|
|
||||||
if (!childBuffer.AllocEmpty(MAX_PATH)) {
|
|
||||||
// Fatal error. We need a buffer to put the path in.
|
|
||||||
return FAILED(returnValue) ? returnValue : E_OUTOFMEMORY;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Recurse into the directory.
|
// Recurse into the directory.
|
||||||
DIR directoryHandle(path.String());
|
DIR directoryHandle(path.String());
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
@ -1526,6 +1520,13 @@ static HRESULT EnsureCorrectPermissions(SimpleAutoString& path,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SimpleAutoString childBuffer;
|
||||||
|
if (!childBuffer.AllocEmpty(MAX_PATH)) {
|
||||||
|
// Just return on this failure rather than continuing. It is unlikely that
|
||||||
|
// this error will go away for the next path we try.
|
||||||
|
return FAILED(returnValue) ? returnValue : E_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
childBuffer.AssignSprintf(MAX_PATH + 1, L"%s\\%s", path.String(),
|
childBuffer.AssignSprintf(MAX_PATH + 1, L"%s\\%s", path.String(),
|
||||||
entry->d_name);
|
entry->d_name);
|
||||||
if (childBuffer.Length() == 0) {
|
if (childBuffer.Length() == 0) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче