netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Denys Fedoryshchenko <denys@visp.net.lb>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>,
	netdev@vger.kernel.org
Subject: Re: iproute2/m_ipt fix, opts was not set properly
Date: Wed, 06 Aug 2008 05:52:52 -0400	[thread overview]
Message-ID: <1218016372.4755.15.camel@localhost> (raw)
In-Reply-To: <200808052224.36773.denys@visp.net.lb>

Denys,

On Tue, 2008-05-08 at 22:24 +0300, Denys Fedoryshchenko wrote:
> Since opts global variable, if it is set to original_opts, it was done in 
> local context of function, and global variable in result was pointing to 
> freed memory. 
> Sure result of that - segfault, it is possible to trigger it 
> only while processing batch, cause only on next iteration opts was wrong.

Are you sure this fixes any segfault? example, the variant you have
below just changes a variable name:

-----
-static void free_opts(struct option *opts)
+static void free_opts(struct option *opts_local)
 {
-       if (opts != original_opts) {
-               free(opts);
+       if (opts_local != original_opts) {
+               free(opts_local);
                opts = original_opts;
                global_option_offset = 0;
        }
-------

You could respin the patch with comment "change bad smelling name of
a variable" - and that would be fine by me.

Please CC me on m_ipt or any of the other actions (as i have asked you
before).

cheers,
jamal


  reply	other threads:[~2008-08-06  9:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-05 19:24 iproute2/m_ipt fix, opts was not set properly Denys Fedoryshchenko
2008-08-06  9:52 ` jamal [this message]
2008-08-06 10:06   ` Denys Fedoryshchenko
2008-08-06 10:42     ` jamal
2008-08-06 10:52       ` jamal
2008-08-06 11:02         ` Denys Fedoryshchenko
2008-08-06 11:18           ` jamal

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=1218016372.4755.15.camel@localhost \
    --to=hadi@cyberus.ca \
    --cc=denys@visp.net.lb \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@linux-foundation.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 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).