summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sal/osl/unx/util.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sal/osl/unx/util.c b/sal/osl/unx/util.c
index 7411e7f2a81a..d40257542503 100644
--- a/sal/osl/unx/util.c
+++ b/sal/osl/unx/util.c
@@ -130,6 +130,9 @@ static int osl_getHWAddr(const char *ifname, char* hard_addr)
struct ifreq ifr;
int so = socket(AF_INET, SOCK_DGRAM, 0);
+ if (strlen(ifname) >= sizeof(ifr.ifr_name))
+ return 0;
+
strcpy(ifr.ifr_name, ifname);
/*