diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-06-24 21:13:37 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-06-25 07:16:49 (GMT) |
commit | 8e052f59f431844ff6576dcf7b47293ab4ef45aa (patch) | |
tree | 39ca68b0ba9e61b1eddc9d2f188951df13e52a9c | |
parent | 2ca01afceeb224d3a5d6f6a1d0eff741337da05d (diff) | |
download | libnl-8e052f59f431844ff6576dcf7b47293ab4ef45aa.zip libnl-8e052f59f431844ff6576dcf7b47293ab4ef45aa.tar.gz libnl-8e052f59f431844ff6576dcf7b47293ab4ef45aa.tar.bz2 |
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>
-rw-r--r-- | lib/attr.c | 2 |
1 files changed, 1 insertions, 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)); |