1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

h2: coverity: check for OOM on dynamic table alloc

It can fail, we should check it.
This commit is contained in:
Andy Green 2021-11-08 10:09:35 +00:00
parent b415f59bd2
commit 1db45d17df

View file

@ -2437,8 +2437,9 @@ upgrade_h2c:
lws_h2_settings(wsi, &wsi->h2.h2n->peer_set, (uint8_t *)tbuf, n);
lws_hpack_dynamic_size(wsi, (int)wsi->h2.h2n->peer_set.s[
H2SET_HEADER_TABLE_SIZE]);
if (lws_hpack_dynamic_size(wsi, (int)wsi->h2.h2n->peer_set.s[
H2SET_HEADER_TABLE_SIZE]))
return 1;
strcpy(tbuf, "HTTP/1.1 101 Switching Protocols\x0d\x0a"
"Connection: Upgrade\x0d\x0a"