All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Moore <paul.moore@hp.com>
To: David Howells <dhowells@redhat.com>
Cc: sds@tycho.nsa.gov, jmorris@namei.org, selinux@tycho.nsa.gov
Subject: Re: [PATCH] Fix a potentially uninitialised variable in SELinux hooks
Date: Wed, 9 Jul 2008 21:23:40 -0400	[thread overview]
Message-ID: <200807092123.40667.paul.moore@hp.com> (raw)
In-Reply-To: <8883.1215645130@redhat.com>

On Wednesday 09 July 2008 7:12:10 pm David Howells wrote:
> Paul Moore <paul.moore@hp.com> wrote:
> > 	ret = selinux_parse_skb_ipv4(...);
> > 	if (ret != 0)
> > 		addrp = (src ? ...);
> > 	else
> > 		addrp = NULL;
>
> I guess you mean "*addrp = ..." in that case, otherwise you haven't
> eliminated anything.

Yes, I did.  Too much pseudo in my pseudo-code I guess.

> Personally, I prefer to add extra variables if it makes things
> clearer, and I prefer to use gotos for error handling.  It eliminates
> the else-statements that you would otherwise introduce, and the
> goto-label can be used as documentation of a sort too.  Furthermore,
> it moves the error handling clearly out of the main route through the
> function.  Having said that, I should reorder my patch to put the
> parse_error segment last - then I can ditch the okay label and use
> break instead of goto.
>
> It comes down to personal preference, I guess.

Doesn't it always :)

I don't think it makes a huge difference either way, and since you are 
the one fixing the problem I'll let you decide.

-- 
paul moore
linux @ hp

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

      reply	other threads:[~2008-07-10  1:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-09 16:10 [PATCH] Fix a potentially uninitialised variable in SELinux hooks David Howells
2008-07-09 22:21 ` Paul Moore
2008-07-09 22:39   ` David Howells
2008-07-09 22:47     ` Paul Moore
2008-07-09 23:12       ` David Howells
2008-07-10  1:23         ` Paul Moore [this message]

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=200807092123.40667.paul.moore@hp.com \
    --to=paul.moore@hp.com \
    --cc=dhowells@redhat.com \
    --cc=jmorris@namei.org \
    --cc=sds@tycho.nsa.gov \
    --cc=selinux@tycho.nsa.gov \
    /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.