projects
/
suckless
/
slstatus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
11fec4f
)
wifi_essid: add boundary check && prevent the use of direct string literal as a forma...
author
raiz
<raiz@firemail.cc>
Tue, 27 Dec 2016 17:14:45 +0000
(20:14 +0300)
committer
raiz
<raiz@firemail.cc>
Tue, 27 Dec 2016 17:14:45 +0000
(20:14 +0300)
slstatus.c
patch
|
blob
|
history
diff --git
a/slstatus.c
b/slstatus.c
index 7b022053fd698e65408ed1d07b3e1086dde35dde..c852b2f2916642c15b4de471b03d5da1c07460ab 100644
(file)
--- a/
slstatus.c
+++ b/
slstatus.c
@@
-717,7
+717,8
@@
wifi_essid(const char *iface)
memset(&wreq, 0, sizeof(struct iwreq));
wreq.u.essid.length = IW_ESSID_MAX_SIZE+1;
- sprintf(wreq.ifr_name, iface);
+ snprintf(wreq.ifr_name, ifrn_name, "%s", iface);
+
if (sockfd == -1) {
warn("Failed to get ESSID for interface %s", iface);
return smprintf("%s", UNKNOWN_STR);