зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1611482: Prevent the existance of dangling pointers upon failure of FindDataStart. r=spohl,valentin
Differential Revision: https://phabricator.services.mozilla.com/D60997 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
b9b9e096b9
Коммит
e4c3013b95
|
@ -215,16 +215,17 @@ nsresult nsZipHandle::Init(nsIFile* file, nsZipHandle** ret, PRFileDesc** aFd) {
|
|||
#else
|
||||
handle->mNSPRFileDesc = fd.forget();
|
||||
#endif
|
||||
handle->mMap = map;
|
||||
handle->mFile.Init(file);
|
||||
handle->mTotalLen = (uint32_t)size;
|
||||
handle->mFileStart = buf;
|
||||
rv = handle->findDataStart();
|
||||
if (NS_FAILED(rv)) {
|
||||
PR_MemUnmap(buf, (uint32_t)size);
|
||||
handle->mFileStart = nullptr;
|
||||
PR_CloseFileMap(map);
|
||||
return rv;
|
||||
}
|
||||
handle->mMap = map;
|
||||
handle.forget(ret);
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче