response.c: better handle broken situation

This commit is contained in:
Evgeny Grin (Karlson2k)
2022-05-29 21:35:11 +03:00
parent 018e77a4f0
commit 8d9eb70d7a
+5 -1
View File
@@ -273,7 +273,11 @@ add_response_header_connection (struct MHD_Response *response,
&norm_len_s);
mhd_assert (0 <= norm_len_s);
if (0 > norm_len_s)
norm_len = 0; /* Must never happen */
{
/* Must never happen with realistic sizes */
free (buf);
return MHD_NO;
}
else
norm_len = (size_t) norm_len_s;
}