From cb78bb0949a5be6eab74c32f690bfca306b24001 Mon Sep 17 00:00:00 2001 From: Rob Davies Date: Mon, 12 Aug 2024 09:38:47 +0100 Subject: [PATCH] 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 --- hfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hfile.c b/hfile.c index 1241dcccb..552b71774 100644 --- a/hfile.c +++ b/hfile.c @@ -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)