summaryrefslogtreecommitdiffstats
path: root/buffered-reader
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-03-26 10:10:21 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-03-26 15:17:26 +0100
commit09fdfda9be3fbc9ec9264c3a1420520ef48e2eb4 (patch)
tree3428b6730672f95708c84c5ac21d15c2c7bc4e4c /buffered-reader
parente54defb3f19ddb5b73856d86b2318a12ea616c4e (diff)
buffered-reader: Fix error handling.
- Hat tip to Fabian Freyer of Radically Open Security.
Diffstat (limited to 'buffered-reader')
-rw-r--r--buffered-reader/src/file_unix.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/buffered-reader/src/file_unix.rs b/buffered-reader/src/file_unix.rs
index 5f6ebb75..69065296 100644
--- a/buffered-reader/src/file_unix.rs
+++ b/buffered-reader/src/file_unix.rs
@@ -134,7 +134,7 @@ impl<'a, C> File<'a, C> {
mmap(ptr::null_mut(), length, PROT_READ, MAP_PRIVATE,
fd, 0)
};
- if addr.is_null() {
+ if addr == libc::MAP_FAILED {
return generic(file, cookie);
}