[PATCH 09/11] net: getenv_ip: check return value of string_to_ip

Wolfram Sang w.sang at pengutronix.de
Sun Sep 25 16:54:12 EDT 2011


Return 0 if we encounter an error.

Signed-off-by: Wolfram Sang <w.sang at pengutronix.de>
---
 net/net.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/net.c b/net/net.c
index 3578118..8416861 100644
--- a/net/net.c
+++ b/net/net.c
@@ -136,7 +136,8 @@ IPaddr_t getenv_ip(const char *name)
 	if (!var)
 		return 0;
 
-	string_to_ip(var, &ip);
+	if (string_to_ip(var, &ip))
+		return 0;
 
 	return ip;
 }
-- 
1.7.5.4




More information about the barebox mailing list