mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
coverity 192910: check length in h2 header dump
Since the NUL was always taken care of at the end of buf, the worst it could do was log some junk. This makes it explicitly log it as oversize separately.
This commit is contained in:
parent
f6ae0edf8d
commit
66b73c680c
1 changed files with 6 additions and 3 deletions
|
@ -1382,10 +1382,13 @@ lws_h2_parse_end_of_frame(struct lws *wsi)
|
|||
continue;
|
||||
}
|
||||
|
||||
lws_hdr_copy(h2n->swsi, buf, sizeof buf, n);
|
||||
buf[sizeof(buf) - 1] = '\0';
|
||||
if (lws_hdr_copy(h2n->swsi, buf, sizeof buf, n) < 0) {
|
||||
lwsl_info(" %s !oversize!\n", (char *)c);
|
||||
} else {
|
||||
buf[sizeof(buf) - 1] = '\0';
|
||||
|
||||
lwsl_info(" %s = %s\n", (char *)c, buf);
|
||||
lwsl_info(" %s = %s\n", (char *)c, buf);
|
||||
}
|
||||
n++;
|
||||
} while (c);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue