mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-01-21 06:10:56 +07:00
wireless: airo: potential buffer overflow in sprintf()
It looks like we wanted to print a maximum of BSSList_rid.ssidLen bytes
of the ssid, but we accidentally use "%*s" (width) instead of "%.*s"
(precision) so if the ssid doesn't have a NUL terminator this could lead
to an overflow.
Static analysis. Not tested.
Fixes: e174961ca1
("net: convert print_mac to %pM")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
parent
963b307361
commit
3d39e1bb1c
@ -5462,7 +5462,7 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
|
||||
we have to add a spin lock... */
|
||||
rc = readBSSListRid(ai, doLoseSync, &BSSList_rid);
|
||||
while(rc == 0 && BSSList_rid.index != cpu_to_le16(0xffff)) {
|
||||
ptr += sprintf(ptr, "%pM %*s rssi = %d",
|
||||
ptr += sprintf(ptr, "%pM %.*s rssi = %d",
|
||||
BSSList_rid.bssid,
|
||||
(int)BSSList_rid.ssidLen,
|
||||
BSSList_rid.ssid,
|
||||
|
Loading…
Reference in New Issue
Block a user