diff options
author | raiz <raiz@firemail.cc> | 2016-12-27 20:14:45 +0300 |
---|---|---|
committer | raiz <raiz@firemail.cc> | 2016-12-27 20:14:45 +0300 |
commit | e969d5ed6cca4466256a5acb29083f9ba5e9dcd6 (patch) | |
tree | c117e09a7e879a25ed12fe88f162c16d502d42c0 | |
parent | 2056cf54e29595166800744daf412c65cafc27cd (diff) |
wifi_essid: add boundary check && prevent the use of direct string literal as a format string in snprintf()
-rw-r--r-- | slstatus.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |