Skip to content
Snippets Groups Projects
Commit 5a689439 authored by Peng Fan's avatar Peng Fan Committed by Tom Rini
Browse files

common: env: initialize scalar variable


Before calling hsearch_r, initialize callback entry to NULL.

Coverity log:
"
Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value e.
Field e.callback is uninitialized when calling hsearch_r.
"

Reported-by: Coverity
Signed-off-by: Peng Fan's avatarPeng Fan <peng.fan@nxp.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
parent 09a78862
No related branches found
No related tags found
No related merge requests found
......@@ -97,6 +97,7 @@ static int set_callback(const char *name, const char *value, void *priv)
e.key = name;
e.data = NULL;
e.callback = NULL;
hsearch_r(e, FIND, &ep, &env_htab, 0);
/* does the env variable actually exist? */
......
......@@ -455,6 +455,7 @@ static int set_flags(const char *name, const char *value, void *priv)
e.key = name;
e.data = NULL;
e.callback = NULL;
hsearch_r(e, FIND, &ep, &env_htab, 0);
/* does the env variable actually exist? */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment