about summary refs log tree commit diff
path: root/pkgs/servers/mqtt/nanomq/0.18.2-CVE-2024-31040.patch
blob: 0453415e88d6408229902df887bce8879765d576 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Based on upstream
https://github.com/nanomq/NanoNNG/commit/543ce93017a488c5001ac450c2a2c1ff6dca19d1
with conflicting formatting changes removed

--- a/nng/src/sp/protocol/mqtt/mqtt_parser.c
+++ b/nng/src/sp/protocol/mqtt/mqtt_parser.c
@@ -583,7 +583,7 @@
 	if (cparam->pro_ver == MQTT_PROTOCOL_VERSION_v5) {
 		// check length
 		log_trace("Decoding MQTT V5 Properties");
-		if (pos >= max)
+		if (pos + 4 >= max)
 			return PROTOCOL_ERROR;
 		cparam->prop_len = (uint32_t) get_var_integer(packet + pos,
 													  &len_of_var);