Skip to content

Commit cb537d6

Browse files
authored
Merge pull request #2057 from stephenprocter/master
Problem: zchunk_slurp() causes assert if file can't be opened
2 parents 4cfb257 + dc00307 commit cb537d6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/zchunk.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,9 @@ zchunk_slurp (const char *filename, size_t maxsize)
376376
size = maxsize;
377377

378378
FILE *handle = fopen (filename, "r");
379+
if (!handle)
380+
return NULL;
381+
379382
zchunk_t *chunk = zchunk_read (handle, size);
380383
assert (chunk);
381384
fclose (handle);

0 commit comments

Comments
 (0)