mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-22 06:29:23 +01:00
station: Fix potential buffer overflow
Use a more appropriate printf conversion string in order to avoid
unnecessary implicit conversion which can lead to a buffer overflow.
Reasons similar to commit:
98b758f893
("knownnetworks: fix printing SSID in hex")
This commit is contained in:
parent
dc38964e42
commit
e82dac4b2d
@ -368,7 +368,7 @@ static const char *iwd_network_get_path(struct station *station,
|
||||
netdev_get_path(station->netdev));
|
||||
|
||||
for (i = 0; ssid[i] && pos < sizeof(path); i++)
|
||||
pos += snprintf(path + pos, sizeof(path) - pos, "%02x",
|
||||
pos += snprintf(path + pos, sizeof(path) - pos, "%02hhx",
|
||||
ssid[i]);
|
||||
|
||||
snprintf(path + pos, sizeof(path) - pos, "_%s",
|
||||
|
Loading…
Reference in New Issue
Block a user