Bug 1743225 - Return an error from AutoMemMap::initWithHandle() if MapViewOfFile() returns null. r=jld

Differential Revision: https://phabricator.services.mozilla.com/D132323
This commit is contained in:
Chris Peterson 2021-12-03 04:04:15 +00:00
parent 08f296ee63
commit 1a298a052b

View File

@ -111,6 +111,9 @@ Result<Ok, nsresult> AutoMemMap::initWithHandle(const FileDescriptor& file,
addr = MapViewOfFile(
handle_, prot == PR_PROT_READONLY ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS,
0, 0, size);
if (!addr) {
return Err(NS_ERROR_FAILURE);
}
return Ok();
}