summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPhillip Simbwa <simbwa@gmail.com>2010-12-29 20:01:16 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2011-01-20 20:01:23 (GMT)
commit64911e4b133ff633563d6dd2b021fa1ca0608992 (patch)
tree43b4983c00f37ae8bf3bfc8531fdbe5c352fa6ef /drivers
parenta786f915274ba446865a996515c7790a930f04dd (diff)
downloadlinux-64911e4b133ff633563d6dd2b021fa1ca0608992.tar.xz
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c
index 0e298db..29b8ab4 100644
--- a/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c
+++ b/drivers/staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c
@@ -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);