Skip to content
Commit 11c5d490 authored by Gerson Fernando Budke's avatar Gerson Fernando Budke Committed by Anas Nashif
Browse files

lib: 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: default avatarGerson Fernando Budke <gerson.budke@ossystems.com.br>
parent 39717ecf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment