Skip to content

Commit

Permalink
Staging: ath6kl: fix potential buffer overflow
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Phillip Simbwa authored and Greg Kroah-Hartman committed Jan 20, 2011
1 parent a786f91 commit 64911e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 64911e4

Please sign in to comment.