Kaydet (Commit) 38b39d3f authored tarafından David Tardon's avatar David Tardon

coverity: protect against buffer overflow

Change-Id: Id3b47712ee1457bda5313a0665a9bb34db035cb0
üst ac45c986
...@@ -130,6 +130,9 @@ static int osl_getHWAddr(const char *ifname, char* hard_addr) ...@@ -130,6 +130,9 @@ static int osl_getHWAddr(const char *ifname, char* hard_addr)
struct ifreq ifr; struct ifreq ifr;
int so = socket(AF_INET, SOCK_DGRAM, 0); int so = socket(AF_INET, SOCK_DGRAM, 0);
if (strlen(ifname) >= sizeof(ifr.ifr_name))
return 0;
strcpy(ifr.ifr_name, ifname); strcpy(ifr.ifr_name, ifname);
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment