Skip to content

Commit 20d4a42

Browse files
authored
Merge pull request #51 from vax-r/Fix_size_in_snprintf
Correct the used of snprintf in owinterface_add
2 parents b737958 + e5eb949 commit 20d4a42

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vwifi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1220,7 +1220,7 @@ static struct wireless_dev *owinterface_add(struct wiphy *wiphy, int if_idx)
12201220
* address (the first byte of multicast addrs is odd).
12211221
*/
12221222
char intf_name[ETH_ALEN] = {0};
1223-
snprintf(intf_name + 1, ETH_ALEN, "%s%d", NAME_PREFIX, if_idx);
1223+
snprintf(intf_name + 1, ETH_ALEN - 1, "%s%d", NAME_PREFIX, if_idx);
12241224

12251225
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
12261226
eth_hw_addr_set(vif->ndev, intf_name);

0 commit comments

Comments
 (0)