summaryrefslogtreecommitdiffstats
path: root/net/net.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/net.c')
-rw-r--r--net/net.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/net.c b/net/net.c
index 26ba44e221..2752884716 100644
--- a/net/net.c
+++ b/net/net.c
@@ -166,8 +166,10 @@ int string_to_ethaddr(const char *str, char *enetaddr)
int reg;
char *e;
- if (!str || strlen(str) != 17)
- return -1;
+ if (!str || strlen(str) != 17) {
+ memset(enetaddr, 0, 6);
+ return -1;
+ }
if (str[2] != ':' || str[5] != ':' || str[8] != ':' ||
str[11] != ':' || str[14] != ':')