Merge pull request #310892 from risicle/ris-nanomq-CVE-2024-31040-r23.11

[23.11] nanomq: add patches for CVE-2024-31040 & CVE-2024-31041
This commit is contained in:
Thomas Gerbet
2024-05-14 08:39:05 +02:00
committed by GitHub
2 changed files with 19 additions and 0 deletions

View File

@@ -0,0 +1,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);

View File

@@ -52,6 +52,10 @@ in stdenv.mkDerivation (finalAttrs: {
fetchSubmodules = true;
};
patches = [
./0.18.2-CVE-2024-31040.patch
];
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "DESTINATION /etc" "DESTINATION $out/etc"