Replace remainining strncpy() uses with strlcpy()
Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
41c526f357
commit
24f051eb14
4 changed files with 6 additions and 6 deletions
|
@ -894,7 +894,7 @@ static int atheros_set_qos_map(void *ctx, const u8 *qos_map_set,
|
|||
memset(&req, 0, sizeof(struct ieee80211req_athdbg));
|
||||
req.cmd = IEEE80211_DBGREQ_SETQOSMAPCONF;
|
||||
os_memset(&iwr, 0, sizeof(iwr));
|
||||
os_strncpy(iwr.ifr_name, drv->iface, sizeof(iwr.ifr_name));
|
||||
os_strlcpy(iwr.ifr_name, drv->iface, sizeof(iwr.ifr_name));
|
||||
iwr.u.data.pointer = (void *) &req;
|
||||
iwr.u.data.length = sizeof(struct ieee80211req_athdbg);
|
||||
}
|
||||
|
@ -1385,7 +1385,7 @@ static void fetch_pending_big_events(struct atheros_driver_data *drv)
|
|||
|
||||
while (1) {
|
||||
os_memset(&iwr, 0, sizeof(iwr));
|
||||
os_strncpy(iwr.ifr_name, drv->iface, IFNAMSIZ);
|
||||
os_strlcpy(iwr.ifr_name, drv->iface, IFNAMSIZ);
|
||||
|
||||
iwr.u.data.pointer = (void *) tbuf;
|
||||
iwr.u.data.length = sizeof(tbuf);
|
||||
|
|
|
@ -72,7 +72,7 @@ get80211opmode(struct bsd_driver_data *drv)
|
|||
struct ifmediareq ifmr;
|
||||
|
||||
(void) memset(&ifmr, 0, sizeof(ifmr));
|
||||
(void) strncpy(ifmr.ifm_name, drv->ifname, sizeof(ifmr.ifm_name));
|
||||
(void) os_strlcpy(ifmr.ifm_name, drv->ifname, sizeof(ifmr.ifm_name));
|
||||
|
||||
if (ioctl(drv->sock, SIOCGIFMEDIA, (caddr_t)&ifmr) >= 0) {
|
||||
if (ifmr.ifm_current & IFM_IEEE80211_ADHOC) {
|
||||
|
|
|
@ -3187,7 +3187,7 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg)
|
|||
genlmsg_attrlen(gnlh, 0), NULL);
|
||||
|
||||
if (tb[NL80211_ATTR_WIPHY_NAME])
|
||||
os_strncpy(drv->phyname,
|
||||
os_strlcpy(drv->phyname,
|
||||
nla_get_string(tb[NL80211_ATTR_WIPHY_NAME]),
|
||||
sizeof(drv->phyname));
|
||||
if (tb[NL80211_ATTR_MAX_NUM_SCAN_SSIDS])
|
||||
|
@ -10656,7 +10656,7 @@ static int android_pno_start(struct i802_bss *bss,
|
|||
|
||||
memset(&ifr, 0, sizeof(ifr));
|
||||
memset(&priv_cmd, 0, sizeof(priv_cmd));
|
||||
os_strncpy(ifr.ifr_name, bss->ifname, IFNAMSIZ);
|
||||
os_strlcpy(ifr.ifr_name, bss->ifname, IFNAMSIZ);
|
||||
|
||||
priv_cmd.buf = buf;
|
||||
priv_cmd.used_len = bp;
|
||||
|
|
|
@ -2427,7 +2427,7 @@ static int wext_sched_scan(void *priv, struct wpa_driver_scan_params *params,
|
|||
bp += WEXT_PNO_MAX_REPEAT_LENGTH + 1;
|
||||
|
||||
os_memset(&iwr, 0, sizeof(iwr));
|
||||
os_strncpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
|
||||
os_strlcpy(iwr.ifr_name, drv->ifname, IFNAMSIZ);
|
||||
iwr.u.data.pointer = buf;
|
||||
iwr.u.data.length = bp;
|
||||
|
||||
|
|
Loading…
Reference in a new issue