Skip to content

Commit b14639f

Browse files
daviesrobwhitwham
authored andcommitted
Check underlying hopen() worked for preload: URLs
Otherwise, we might try to hread() a NULL pointer. Credit to OSS_Fuzz Fixes oss-fuzz id 71069
1 parent 2e32e7f commit b14639f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ static int is_preload_url_remote(const char *url){
703703

704704
static hFILE *hopen_preload(const char *url, const char *mode){
705705
hFILE* fp = hopen(url + 8, mode);
706-
return hpreload(fp);
706+
return fp ? hpreload(fp) : NULL;
707707
}
708708

709709
hFILE *hdopen(int fd, const char *mode)

0 commit comments

Comments
 (0)