projects
/
project
/
netifd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
55a7b6b
)
system-linux: initialize ifreq struct before using it
author
Alin Nastac
<alin.nastac@gmail.com>
Thu, 8 Oct 2020 11:31:37 +0000
(13:31 +0200)
committer
Hans Dedecker
<dedeckeh@gmail.com>
Sat, 10 Oct 2020 07:39:58 +0000
(09:39 +0200)
Signed-off-by: Alin Nastac <alin.nastac@gmail.com>
system-linux.c
patch
|
blob
|
history
diff --git
a/system-linux.c
b/system-linux.c
index 6778b1d56c949c4aefa4980bdccc48e31419ff8c..91888990440e953898bedaf8739303ee68072ed8 100644
(file)
--- a/
system-linux.c
+++ b/
system-linux.c
@@
-904,6
+904,8
@@
failure:
int system_if_resolve(struct device *dev)
{
struct ifreq ifr;
+
+ memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, dev->ifname, sizeof(ifr.ifr_name) - 1);
if (!ioctl(sock_ioctl, SIOCGIFINDEX, &ifr))
return ifr.ifr_ifindex;