netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] libnfnetlink: BAD_SIZEOF
@ 2011-06-10  9:11 Jiri Popelka
  2011-06-13 17:52 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Popelka @ 2011-06-10  9:11 UTC (permalink / raw)
  To: netfilter-devel; +Cc: Jiri Popelka

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.
---
 src/libnfnetlink.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

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));
 }
-- 
1.7.5.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libnfnetlink: BAD_SIZEOF
  2011-06-10  9:11 [PATCH] libnfnetlink: BAD_SIZEOF Jiri Popelka
@ 2011-06-13 17:52 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2011-06-13 17:52 UTC (permalink / raw)
  To: Jiri Popelka; +Cc: netfilter-devel

On 10/06/11 11:11, Jiri Popelka wrote:
> 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.

Applied, thanks Jiri.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-13 17:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10  9:11 [PATCH] libnfnetlink: BAD_SIZEOF Jiri Popelka
2011-06-13 17:52 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).