Commit 2971607
committed
Fix: Enforce MQTT v5 property-packet validation and improve decoding safety
Implements necessary protocol validation in MqttEncode_Props and
MqttDecode_Props to ensure that properties are only used in their
allowed packet types, addressing the 'TODO: validate packet type'.
- Defines new error code: MQTT_CODE_ERROR_PROPERTY_MISMATCH.
- Adds critical buffer boundary checks in MqttDecode_Props before
VBI and string decoding to prevent potential buffer overruns.
Signed-off-by: Badr Bacem KAABIA <[email protected]>1 parent ab2088a commit 2971607
2 files changed
+19
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | | - | |
381 | 380 | | |
382 | 381 | | |
383 | 382 | | |
384 | 383 | | |
385 | | - | |
386 | | - | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
387 | 389 | | |
388 | 390 | | |
389 | 391 | | |
| |||
505 | 507 | | |
506 | 508 | | |
507 | 509 | | |
508 | | - | |
509 | | - | |
| 510 | + | |
| 511 | + | |
510 | 512 | | |
511 | 513 | | |
512 | 514 | | |
| 515 | + | |
513 | 516 | | |
514 | 517 | | |
515 | 518 | | |
| |||
520 | 523 | | |
521 | 524 | | |
522 | 525 | | |
523 | | - | |
524 | | - | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
525 | 531 | | |
526 | 532 | | |
527 | 533 | | |
| |||
561 | 567 | | |
562 | 568 | | |
563 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
564 | 575 | | |
565 | 576 | | |
566 | 577 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
| 205 | + | |
205 | 206 | | |
206 | 207 | | |
207 | 208 | | |
| |||
0 commit comments