Skip to content

Commit

Permalink
Merge pull request #51 from vax-r/Fix_size_in_snprintf
Browse files Browse the repository at this point in the history
Correct the used of snprintf in owinterface_add
  • Loading branch information
jserv authored Dec 1, 2023
2 parents b737958 + e5eb949 commit 20d4a42
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vwifi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1220,7 +1220,7 @@ static struct wireless_dev *owinterface_add(struct wiphy *wiphy, int if_idx)
* address (the first byte of multicast addrs is odd).
*/
char intf_name[ETH_ALEN] = {0};
snprintf(intf_name + 1, ETH_ALEN, "%s%d", NAME_PREFIX, if_idx);
snprintf(intf_name + 1, ETH_ALEN - 1, "%s%d", NAME_PREFIX, if_idx);

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

0 comments on commit 20d4a42

Please sign in to comment.