From 23c68e2677d23bca19a8ac0f963ff84ab11ef9e3 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Fri, 10 May 2024 11:12:12 -0300 Subject: [PATCH] silence fuzzer --- src/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/http.c b/src/http.c index c46c5e6d..e4bd1131 100644 --- a/src/http.c +++ b/src/http.c @@ -573,7 +573,7 @@ void mg_http_serve_file(struct mg_connection *c, struct mg_http_message *hm, struct mg_str *ae = mg_http_get_header(hm, "Accept-Encoding"); if (ae != NULL) { char *ae_ = mg_mprintf("%.*s", ae->len, ae->buf); - if (strstr(ae_, "gzip") != NULL) { + if (ae_ != NULL && strstr(ae_, "gzip") != NULL) { mg_snprintf(tmp, sizeof(tmp), "%s.gz", path); fd = mg_fs_open(fs, tmp, MG_FS_READ); if (fd != NULL) gzip = true, path = tmp;