Staging: ath6kl: fix potential buffer overflow
Off by one Signed-off-by: Phillip Simbwa <simbwa at gmail dot com> Signed-off-by: Vipin Mehta <vmehta@atheros.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
Родитель
a786f91527
Коммит
64911e4b13
|
@ -360,8 +360,8 @@ int PSSendOps(void *arg)
|
|||
status = 1;
|
||||
goto complete;
|
||||
}
|
||||
len = (firmware->size > MAX_BDADDR_FORMAT_LENGTH)? MAX_BDADDR_FORMAT_LENGTH: firmware->size;
|
||||
memcpy(config_bdaddr, firmware->data,len);
|
||||
len = min(firmware->size, MAX_BDADDR_FORMAT_LENGTH - 1);
|
||||
memcpy(config_bdaddr, firmware->data, len);
|
||||
config_bdaddr[len] = '\0';
|
||||
write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING);
|
||||
A_RELEASE_FIRMWARE(firmware);
|
||||
|
|
Загрузка…
Ссылка в новой задаче