]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: mqtt: connack parser returns MQTT_NEED_MORE_DATA on unknown property
authorWilly Tarreau <w@1wt.eu>
Mon, 11 May 2026 13:32:34 +0000 (15:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 May 2026 14:04:19 +0000 (16:04 +0200)
In mqtt_parse_connack(), the switch statement's default case for unknown
MQTT properties was using 'return 0' which returns MQTT_NEED_MORE_DATA.
This is misleading: an unknown property should be treated as an invalid
message (MQTT_INVALID_MESSAGE), like other functions do. This branches to
the "end" label without touching the preset return value instead. This can
be backported if needed.

src/mqtt.c

index 8e2f04a7ea2197ad05ea0546cf99b2bfa9d1cdf1..9ff977ef6dba30f112fe6b1cdd625be7f41a3b97 100644 (file)
@@ -1196,7 +1196,7 @@ static int mqtt_parse_connack(struct ist parser, struct mqtt_pkt *mpkt)
                                break;
 
                        default:
-                               return 0;
+                               goto end;
                        }
 
                        if (!isttest(props))