zephyr/subsys/mgmt
Gerson Fernando Budke 9974a2a76a mgmt: updatehub: Fix possible deref an uninitialized ptr
There are several references to objects[1] at updatehub_probe function.
The structures are decoded from json, and have a maximum length of 2.
However, if the returned json only has a single element in this array,
this objects[1] value will be uninitialized. Because the structure
contains pointers, these will be uninitialized, causing the code to
reference uninitialized memory as pointers.

Add zeroing memory before passing it to the JSON API and do check if
objects_len field is two.

Fixes #27718.

Signed-off-by: Gerson Fernando Budke <gerson.budke@ossystems.com.br>
2020-08-31 13:04:36 +02:00
..
mcumgr mgmt: smp: shell: initialize SMP before feeding with received bytes 2020-08-19 09:51:45 -04:00
osdp guideline: Make explicit fallthrough cases 2020-08-24 20:28:47 -04:00
updatehub mgmt: updatehub: Fix possible deref an uninitialized ptr 2020-08-31 13:04:36 +02:00
CMakeLists.txt mgmt/osdp: Add support for OSDP in PD mode of operation 2020-08-13 11:48:28 +02:00
Kconfig kconfig: Management subsystems -> Device Management 2020-08-24 10:24:30 +02:00