mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
![]() This reverts the removal of the deflate_frame code that was crashing after porting David Galeano's code: he pointed out there's a typo in the merged version causing the crash which is fixed here. However the fixed code has a problem, there's no limit (other than int size) to the amount of memory it will try to malloc, which can allow a DoS of the server by the client sending malicious compression states that inflate to a large amount. I have added checking for OOM already that will avert the segfault that would otherwise follow but the server will be unusuable if malicious connections were made repeatedly each forcing it to allocate large buffers and cause small allocations on other connections to fail. The patch changes the code to use realloc(), and introduces a configurable limit on the amount of memory one connection may need for zlib before the server hangs up the connection. It defaults to 64KBytes but can be set from ./configure as described now in the README. Signed-off-by: Andy Green <andy.green@linaro.org> |
||
---|---|---|
.. | ||
.gitignore | ||
base64-decode.c | ||
client-handshake.c | ||
extension-deflate-frame.c | ||
extension-deflate-frame.h | ||
extension-deflate-stream.c | ||
extension-deflate-stream.h | ||
extension-x-google-mux.c | ||
extension-x-google-mux.h | ||
extension.c | ||
getifaddrs.c | ||
getifaddrs.h | ||
handshake.c | ||
libwebsockets.c | ||
libwebsockets.h | ||
Makefile.am | ||
md5.c | ||
parsers.c | ||
private-libwebsockets.h | ||
sha-1.c |