projects
/
oweals
/
iwinfo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1e628bb
)
utils: fix possibly unterminated ifname string
author
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 29 Oct 2015 09:53:48 +0000
(10:53 +0100)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Thu, 29 Oct 2015 09:53:48 +0000
(10:53 +0100)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
iwinfo_utils.c
patch
|
blob
|
history
diff --git
a/iwinfo_utils.c
b/iwinfo_utils.c
index 3b993d124884a061fe8444ac8a871491e03bb379..3090c4cde4a3711fb45b7af22d0d9a52adf5371d 100644
(file)
--- a/
iwinfo_utils.c
+++ b/
iwinfo_utils.c
@@
-81,7
+81,7
@@
int iwinfo_ifup(const char *ifname)
{
struct ifreq ifr;
- strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+ strncpy(ifr.ifr_name, ifname, IFNAMSIZ
- 1
);
if (iwinfo_ioctl(SIOCGIFFLAGS, &ifr))
return 0;
@@
-95,7
+95,7
@@
int iwinfo_ifdown(const char *ifname)
{
struct ifreq ifr;
- strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+ strncpy(ifr.ifr_name, ifname, IFNAMSIZ
- 1
);
if (iwinfo_ioctl(SIOCGIFFLAGS, &ifr))
return 0;
@@
-109,7
+109,7
@@
int iwinfo_ifmac(const char *ifname)
{
struct ifreq ifr;
- strncpy(ifr.ifr_name, ifname, IFNAMSIZ);
+ strncpy(ifr.ifr_name, ifname, IFNAMSIZ
- 1
);
if (iwinfo_ioctl(SIOCGIFHWADDR, &ifr))
return 0;