Skip to content

Commit

Permalink
Check underlying hopen() worked for preload: URLs
Browse files Browse the repository at this point in the history
Otherwise, we might try to hread() a NULL pointer.

Credit to OSS_Fuzz
Fixes oss-fuzz id 71069
  • Loading branch information
daviesrob authored and whitwham committed Aug 16, 2024
1 parent 2e32e7f commit b14639f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ static int is_preload_url_remote(const char *url){

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

hFILE *hdopen(int fd, const char *mode)
Expand Down

0 comments on commit b14639f

Please sign in to comment.