common: env: initialize scalar variable
PATCH v2 1/1 common: env: initialize scalar variable
From: Peng Fan <[email protected]>
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 <[email protected]>
Cc Tom Rini <[email protected]>
Cc Simon Glass <[email protected]>
--- common/env_callback.c | 1 + common/env_flags.c | 1 + 2 files changed, 2 insertions(+)
common/env_callback.c +1 -0
@@ -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? */
common/env_flags.c +1 -0
@@ -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? */
Signature · 1 line
2.6.2
PATCH v2 1/1 common: env: initialize scalar variable
Quoted 11 lines · Peng Fan
From: Peng Fan <[email protected]>
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 callinghsearch_r. "
Quoted 4 lines
Reported-by CoveritySigned-off-by Peng Fan <[email protected]>Cc Tom Rini <[email protected]>Cc Simon Glass <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160104/b8ff99c6/attachment.sig>