[PATCH 2/2] ifup: fix handling when ip env is not given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 net/ifup.c | 3 +++
 1 file changed, 3 insertions(+)

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@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux