From: Vipin Mehta <vmehta@atheros.com>
To: <greg@kroah.com>
Cc: <linux-wireless@vger.kernel.org>, <simbwa@gmail.com>,
<error27@gmail.com>, <devel@driverdev.osuosl.org>,
Vipin Mehta <vmehta@atheros.com>
Subject: [PATCH] Staging: ath6kl: fix potential buffer overflow
Date: Wed, 29 Dec 2010 12:01:16 -0800 [thread overview]
Message-ID: <1293652876-18594-1-git-send-email-vmehta@atheros.com> (raw)
From: Phillip Simbwa <simbwa@gmail.com>
Off by one
Signed-off-by: Phillip Simbwa <simbwa at gmail dot com>
Signed-off-by: Vipin Mehta <vmehta@atheros.com>
---
.../staging/ath6kl/miscdrv/ar3kps/ar3kpsconfig.c | 4 ++--
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);
--
1.6.3.3
reply other threads:[~2010-12-29 20:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1293652876-18594-1-git-send-email-vmehta@atheros.com \
--to=vmehta@atheros.com \
--cc=devel@driverdev.osuosl.org \
--cc=error27@gmail.com \
--cc=greg@kroah.com \
--cc=linux-wireless@vger.kernel.org \
--cc=simbwa@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox