From: Pablo Neira <pablo@eurodev.net>
To: Netfilter Development Mailinglist <netfilter-devel@lists.netfilter.org>
Cc: Harald Welte <laforge@netfilter.org>
Subject: [PATCH 2/7] Kill bogus memsets
Date: Mon, 01 Aug 2005 19:04:57 +0200 [thread overview]
Message-ID: <42EE5639.6070808@eurodev.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 105 bytes --]
nfattr_parse_attributes already set to zero the array of nfattr, so such
initialization isn't required.
[-- Attachment #2: 01kill-memset.patch --]
[-- Type: text/x-patch, Size: 1558 bytes --]
Index: netfilter-2.6.14/net/ipv4/netfilter/ip_conntrack_netlink.c
===================================================================
--- netfilter-2.6.14.orig/net/ipv4/netfilter/ip_conntrack_netlink.c 2005-08-01 16:20:26.000000000 +0200
+++ netfilter-2.6.14/net/ipv4/netfilter/ip_conntrack_netlink.c 2005-08-01 16:25:00.000000000 +0200
@@ -479,7 +479,6 @@
DEBUGP("entered %s\n", __FUNCTION__);
- memset(tb, 0, CTA_IP_MAX * sizeof(tb));
if (nfattr_parse_nested(tb, CTA_IP_MAX, attr) < 0)
goto nfattr_failure;
@@ -522,8 +521,6 @@
DEBUGP("entered %s\n", __FUNCTION__);
- memset(tb, 0, CTA_PROTO_MAX * sizeof(tb));
-
if (nfattr_parse_nested(tb, CTA_PROTO_MAX, attr) < 0)
goto nfattr_failure;
@@ -556,7 +553,6 @@
DEBUGP("entered %s\n", __FUNCTION__);
- memset(tb, 0, CTA_TUPLE_MAX * sizeof(tb));
memset(tuple, 0, sizeof(*tuple));
if (nfattr_parse_nested(tb, CTA_TUPLE_MAX, cda[type-1]) < 0)
@@ -607,8 +603,6 @@
DEBUGP("entered %s\n", __FUNCTION__);
- memset(tb, 0, CTA_PROTONAT_MAX * sizeof(tb));
-
if (nfattr_parse_nested(tb, CTA_PROTONAT_MAX, attr) < 0)
goto nfattr_failure;
@@ -646,7 +640,6 @@
DEBUGP("entered %s\n", __FUNCTION__);
- memset(tb, 0, CTA_NAT_MAX * sizeof(tb));
memset(range, 0, sizeof(*range));
if (nfattr_parse_nested(tb, CTA_NAT_MAX, cda[CTA_NAT-1]) < 0)
@@ -684,7 +677,6 @@
struct nfattr *tb[CTA_HELP_MAX];
DEBUGP("entered %s\n", __FUNCTION__);
- memset(tb, 0, CTA_HELP_MAX * sizeof(tb));
if (nfattr_parse_nested(tb, CTA_HELP_MAX, attr) < 0)
goto nfattr_failure;
next reply other threads:[~2005-08-01 17:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-01 17:04 Pablo Neira [this message]
2005-08-01 20:20 ` [PATCH 2/7] Kill bogus memsets Harald Welte
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42EE5639.6070808@eurodev.net \
--to=pablo@eurodev.net \
--cc=laforge@netfilter.org \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.