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

win32: zlib: Fix buffer overflow on inflate (CVE-2022-37434)

This commit is contained in:
Orgad Shaneh 2024-10-02 10:13:14 +03:00 committed by Andy Green
parent a1ee5a2c50
commit a544db3020

View file

@ -720,8 +720,9 @@ int flush;
if (copy > have) copy = have;
if (copy) {
if (state->head != Z_NULL &&
state->head->extra != Z_NULL) {
len = state->head->extra_len - state->length;
state->head->extra != Z_NULL &&
(len = state->head->extra_len - state->length) <
state->head->extra_max) {
zmemcpy(state->head->extra + len, next,
len + copy > state->head->extra_max ?
state->head->extra_max - len : copy);