From a82107933da41572428b8c882d77c10267cbcef9 Mon Sep 17 00:00:00 2001 From: Jiri Popelka Date: Fri, 10 Jun 2011 11:11:00 +0200 Subject: src: BAD_SIZEOF static analysis (analysis based only on compiling of sources, not based on running of binary) of the code revealed the following problem: libnfnetlink.c:481: Taking the size of pointer parameter "nlh" is suspicious. libnfnetlink.c:486: Taking the size of pointer parameter "nlh" is suspicious. Signed-off-by: Jiri Popelka Signed-off-by: Pablo Neira Ayuso --- src/libnfnetlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c index 6e7afc6..2f962fc 100644 --- a/src/libnfnetlink.c +++ b/src/libnfnetlink.c @@ -477,12 +477,12 @@ nfnl_parse_hdr(const struct nfnl_handle *nfnlh, if (nlh->nlmsg_len == NLMSG_LENGTH(sizeof(struct nfgenmsg))) { if (genmsg) - *genmsg = (void *)nlh + sizeof(nlh); + *genmsg = (void *)nlh + sizeof(*nlh); return NULL; } if (genmsg) - *genmsg = (void *)nlh + sizeof(nlh); + *genmsg = (void *)nlh + sizeof(*nlh); return (void *)nlh + NLMSG_LENGTH(sizeof(struct nfgenmsg)); } -- cgit v1.2.3