Fragments forming a long message are not caught early
This commit is contained in:
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
# You can select which sanitizer to use by setting this
|
# You can select which sanitizer to use by setting this
|
||||||
SANITIZER ?= address
|
SANITIZER ?= address
|
||||||
# These are set by OSS-Fuzz, we default to AddressSanitizer
|
# These are set by OSS-Fuzz, we default to AddressSanitizer
|
||||||
CXXFLAGS ?= -DLIBUS_NO_SSL -fsanitize=$(SANITIZER),fuzzer
|
override CXXFLAGS += -DLIBUS_NO_SSL -fsanitize=$(SANITIZER),fuzzer
|
||||||
CFLAGS ?= -DLIBUS_NO_SSL
|
override CFLAGS += -DLIBUS_NO_SSL
|
||||||
OUT ?= .
|
OUT ?= .
|
||||||
|
|
||||||
oss-fuzz:
|
oss-fuzz:
|
||||||
|
|||||||
@@ -100,6 +100,11 @@ private:
|
|||||||
if (!webSocketData->fragmentBuffer.length()) {
|
if (!webSocketData->fragmentBuffer.length()) {
|
||||||
webSocketData->fragmentBuffer.reserve(length + remainingBytes);
|
webSocketData->fragmentBuffer.reserve(length + remainingBytes);
|
||||||
}
|
}
|
||||||
|
/* Fragments forming a big message are not caught until appending them */
|
||||||
|
if (refusePayloadLength(length + webSocketData->fragmentBuffer.length(), webSocketState, s)) {
|
||||||
|
forceClose(webSocketState, s);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
webSocketData->fragmentBuffer.append(data, length);
|
webSocketData->fragmentBuffer.append(data, length);
|
||||||
|
|
||||||
/* Are we done now? */
|
/* Are we done now? */
|
||||||
|
|||||||
Reference in New Issue
Block a user