Fix #1444 - clang warns on undefined behavior with null pointers

This commit is contained in:
Sergey Lyubka committed 2022-01-14 09:55:15 +00:00
1 parent 9fd80fd136
commit c53e2fcc14
3 files changed
+8 -6

No files matched your search

+1 -1
View File
@@ -919,7 +919,7 @@ void mg_http_delete_chunk(struct mg_connection *c, struct mg_http_message *hm) {
static void http_cb(struct mg_connection *c, int ev, void *evd, void *fnd) {
if (ev == MG_EV_READ || ev == MG_EV_CLOSE) {
struct mg_http_message hm;
for (;;) {
while (c->recv.buf != NULL && c->recv.len > 0) {
int n = mg_http_parse((char *) c->recv.buf, c->recv.len, &hm);
bool is_chunked = n > 0 && mg_is_chunked(&hm);
if (ev == MG_EV_CLOSE) {