mirror of
https://dev.iopsys.eu/bbf/bbfdm.git
synced 2025-12-10 07:44:39 +01:00
dmentryjson.c: Fix use of uninitialized memory
next_obj wasn't initialized when the object number was zero. Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
This commit is contained in:
parent
033380161d
commit
f9a9896005
1 changed files with 5 additions and 5 deletions
|
|
@ -683,12 +683,12 @@ static void parse_obj(char *object, json_object *jobj, DMOBJ *pobj, int index, s
|
|||
pobj[index].obj = obj_str;
|
||||
|
||||
//nextobj
|
||||
if (obj_number != 0) {
|
||||
if (obj_number != 0)
|
||||
next_obj = dmcallocjson(obj_number+1, sizeof(struct dm_obj_s));
|
||||
pobj[index].nextobj = next_obj;
|
||||
} else {
|
||||
pobj[index].nextobj = NULL;
|
||||
}
|
||||
else
|
||||
next_obj = NULL;
|
||||
|
||||
pobj[index].nextobj = next_obj;
|
||||
|
||||
//leaf
|
||||
if (param_number != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue