Merge pull request #2749 from cesanta/strip

silence fuzzer
This commit is contained in:
Sergio R. Caprile authored and GitHub committed 2024-05-10 12:14:59 -03:00
commit b316989378
1 file changed
+1 -1
+1 -1
View File
@@ -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"); struct mg_str *ae = mg_http_get_header(hm, "Accept-Encoding");
if (ae != NULL) { if (ae != NULL) {
char *ae_ = mg_mprintf("%.*s", ae->len, ae->buf); 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); mg_snprintf(tmp, sizeof(tmp), "%s.gz", path);
fd = mg_fs_open(fs, tmp, MG_FS_READ); fd = mg_fs_open(fs, tmp, MG_FS_READ);
if (fd != NULL) gzip = true, path = tmp; if (fd != NULL) gzip = true, path = tmp;