Skip to content

Commit 3095e82

Browse files
committed
common: resolve_unique: Fix uninitialised return of pointer item
In the case where resolve_unique does not resolve a unique symbol the uninitialzed pointer item is returned which is problematic because the caller performs a NULL check on this. Fix this be initializing item to NULL at the start. Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
1 parent 020fe25 commit 3095e82

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/os/sym.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,7 @@ sym_resolve(sym_t *sym, uint64_t addr, sym_item_t **item_arr,
842842
static sym_item_t *
843843
resolve_unique(sym_t *sym, uint64_t addr, sym_item_t **arr, uint64_t *base_addr)
844844
{
845-
sym_item_t *item_arr, *item;
845+
sym_item_t *item_arr, *item = NULL;
846846
int num, i;
847847

848848
if (sym_resolve(sym, addr, &item_arr, &num, base_addr) != 0) {

0 commit comments

Comments
 (0)