attr: prevent garbage return value for NULL param
If nla is not given, then tmp is not set. Explicitly initalize with 0 to prevent garbage values. Found by Clang static analyzer. Signed-off-by: Peter Wu <peter@lekensteyn.nl> Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
2ca01afcee
commit
8e052f59f4
1 changed files with 1 additions and 1 deletions
|
@ -648,7 +648,7 @@ int nla_put_u64(struct nl_msg *msg, int attrtype, uint64_t value)
|
|||
*/
|
||||
uint64_t nla_get_u64(struct nlattr *nla)
|
||||
{
|
||||
uint64_t tmp;
|
||||
uint64_t tmp = 0;
|
||||
|
||||
nla_memcpy(&tmp, nla, sizeof(tmp));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue