mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-18 10:59:45 +00:00
Enable WS data size check
This commit is contained in:
1 parent
a70c5e726d
commit
40b3382023
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -4533,7 +4533,7 @@ static size_t ws_process(uint8_t *buf, size_t len, struct ws_msg *msg) {
|
||||
}
|
||||
// Sanity check, and integer overflow protection for the boundary check below
|
||||
// data_len should not be larger than 1 Gb
|
||||
// if (msg->data_len > 1024 * 1024 * 1024) return 0;
|
||||
if (msg->data_len > 1024 * 1024 * 1024) return 0;
|
||||
if (msg->header_len + msg->data_len > len) return 0;
|
||||
if (mask_len > 0) {
|
||||
uint8_t *p = buf + msg->header_len, *m = p - mask_len;
|
||||
|
||||
@@ -66,7 +66,7 @@ static size_t ws_process(uint8_t *buf, size_t len, struct ws_msg *msg) {
|
||||
}
|
||||
// Sanity check, and integer overflow protection for the boundary check below
|
||||
// data_len should not be larger than 1 Gb
|
||||
// if (msg->data_len > 1024 * 1024 * 1024) return 0;
|
||||
if (msg->data_len > 1024 * 1024 * 1024) return 0;
|
||||
if (msg->header_len + msg->data_len > len) return 0;
|
||||
if (mask_len > 0) {
|
||||
uint8_t *p = buf + msg->header_len, *m = p - mask_len;
|
||||
|
||||
Reference in new issue
Block a user