Merge branch 'coverity-fixes-2'

http://lists.infradead.org/pipermail/libnl/2014-June/001507.html

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2014-06-25 09:26:49 +02:00
commit baaf82d6d6
3 changed files with 8 additions and 5 deletions

View file

@ -205,7 +205,7 @@ extern int nla_is_nested(struct nlattr *);
* @arg value NUL terminated character string.
*/
#define NLA_PUT_STRING(msg, attrtype, value) \
NLA_PUT(msg, attrtype, strlen(value) + 1, value)
NLA_PUT(msg, attrtype, (int) strlen(value) + 1, value)
/**
* Add flag attribute to netlink message.

View file

@ -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));

View file

@ -170,9 +170,12 @@ static int u32_clone(void *_dst, void *_src)
!(dst->cu_selector = nl_data_clone(src->cu_selector)))
return -NLE_NOMEM;
if (src->cu_act && !(dst->cu_act = rtnl_act_alloc()))
return -NLE_NOMEM;
memcpy(dst->cu_act, src->cu_act, sizeof(struct rtnl_act));
if (src->cu_act) {
if (!(dst->cu_act = rtnl_act_alloc()))
return -NLE_NOMEM;
memcpy(dst->cu_act, src->cu_act, sizeof(struct rtnl_act));
}
if (src->cu_police && !(dst->cu_police = nl_data_clone(src->cu_police)))
return -NLE_NOMEM;