mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Aring <aar@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 2/2] ifup: fix handling when ip env is not given
Date: Wed, 15 Jun 2016 07:43:17 +0200	[thread overview]
Message-ID: <20160615054317.GB9677@pengutronix.de> (raw)
In-Reply-To: <20160614065506.25821-2-aar@pengutronix.de>

On Tue, Jun 14, 2016 at 08:55:06AM +0200, Alexander Aring wrote:
> This patch handles the ip env to "" if no ip env is given. Otherwise
> we get a NULL pointer derefence.
> 
> Signed-off-by: Alexander Aring <aar@pengutronix.de>
> ---
>  net/ifup.c | 3 +++
>  1 file changed, 3 insertions(+)

Applied, thanks

Sascha

> 
> diff --git a/net/ifup.c b/net/ifup.c
> index 17e1b2f..59df069 100644
> --- a/net/ifup.c
> +++ b/net/ifup.c
> @@ -94,6 +94,9 @@ int ifup(const char *name, unsigned flags)
>  		goto out;
>  
>  	ip = getenv("ip");
> +	if (!ip)
> +		ip = "";
> +
>  	if (!strcmp(ip, "dhcp")) {
>  		ret = run_command("dhcp");
>  		if (ret)
> -- 
> 2.8.3
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2016-06-15  5:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-14  6:55 [PATCH 1/2] ifup: remove deletion of ip env Alexander Aring
2016-06-14  6:55 ` [PATCH 2/2] ifup: fix handling when ip env is not given Alexander Aring
2016-06-15  5:43   ` Sascha Hauer [this message]
2016-06-15  5:40 ` [PATCH 1/2] ifup: remove deletion of ip env Sascha Hauer

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=20160615054317.GB9677@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=aar@pengutronix.de \
    --cc=barebox@lists.infradead.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