Issue 294: mmap error checking is not correct.

R=Liu



git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@312 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
nealsid
2009-02-22 01:31:43 +00:00
parent 0fd2f1ae21
commit cadc8ddde9
4 changed files with 4 additions and 4 deletions

View File

@@ -101,7 +101,7 @@ bool FileID::ElfFileIdentifier(unsigned char identifier[16]) {
}
void *base = mmap(NULL, st.st_size,
PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
if (!base) {
if (base == MAP_FAILED) {
close(fd);
return false;
}