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:
Phillip Simbwa 2010-12-29 12:01:16 -08:00 коммит произвёл Greg Kroah-Hartman
Родитель a786f91527
Коммит 64911e4b13
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -360,8 +360,8 @@ int PSSendOps(void *arg)
status = 1; status = 1;
goto complete; goto complete;
} }
len = (firmware->size > MAX_BDADDR_FORMAT_LENGTH)? MAX_BDADDR_FORMAT_LENGTH: firmware->size; len = min(firmware->size, MAX_BDADDR_FORMAT_LENGTH - 1);
memcpy(config_bdaddr, firmware->data,len); memcpy(config_bdaddr, firmware->data, len);
config_bdaddr[len] = '\0'; config_bdaddr[len] = '\0';
write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING); write_bdaddr(hdev,config_bdaddr,BDADDR_TYPE_STRING);
A_RELEASE_FIRMWARE(firmware); A_RELEASE_FIRMWARE(firmware);