Permalink
Browse files

Fix mmap() return value handling

Found by: michaelortmann
Patch by: michaelortmann
  • Loading branch information...
michaelortmann authored and vanosg committed Sep 9, 2018
1 parent 9deeeeb commit 199938a73fe8849d78bdb67c2fb63679f7965ba8
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/mod/compress.mod/compress.c
@@ -200,7 +200,7 @@ static int compress_to_file_mmap(gzFile fout, FILE *fin)
/* mmap file contents to memory */
buf = mmap(0, st.st_size, PROT_READ, MAP_SHARED, ifd, 0);
if (buf < 0)
if (buf == MAP_FAILED)
return COMPF_ERROR;
/* Compress the whole file in one go */

0 comments on commit 199938a

Please sign in to comment.