From: Stephen Hemminger <stephen@networkplumber•org>
To: andreas.greve@a-greve•de
Cc: netdev@vger•kernel.org
Subject: Re: Bug: tc filter show .... raise segfault if more than one rule with action -j MARK exist
Date: Fri, 9 May 2014 13:34:24 -0700 [thread overview]
Message-ID: <20140509133424.7dc93da3@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <536B6F03.5040401@a-greve.de>
On Thu, 08 May 2014 13:48:19 +0200
Andreas Greve <andreas.greve@a-greve•de> wrote:
> + /*
> + clone tcipt_globals because .opts and .options_offset will be modified later and not
> + restored by iptables. If tcipt_globals is not cloned the modification tcipt_globals will
> + cause a segmentation fault if more than one filter rule with action -j exists.
> + */
> + struct xtables_globals tmp_tcipt_globals;
> + memcpy (&tmp_tcipt_globals, &tcipt_globals, sizeof(struct xtables_globals) );
> +
Please use structure assignment instead of memcpy().
Structure assignment makes sure that types match. mempcpy does not.
next prev parent reply other threads:[~2014-05-09 20:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-08 11:48 Bug: tc filter show .... raise segfault if more than one rule with action -j MARK exist Andreas Greve
2014-05-09 20:34 ` Stephen Hemminger [this message]
2014-05-10 9:11 ` Andreas Greve
2014-05-10 9:19 ` Andreas Greve
2014-05-13 20:10 ` Stephen Hemminger
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=20140509133424.7dc93da3@nehalam.linuxnetplumber.net \
--to=stephen@networkplumber$(echo .)org \
--cc=andreas.greve@a-greve$(echo .)de \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox