aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/vt6656
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2012-10-11 09:55:25 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-22 13:26:40 -0700
commitc25015c1184e7e54c02e0dfd5044eec38dec482c (patch)
tree8d2158d00b6c10e6dcf2ec6083e6562ebca97c84 /drivers/staging/vt6656
parentStaging: vt6655-6: shift wrap buf in s_vFillTxKey() (diff)
downloadlinux-dev-c25015c1184e7e54c02e0dfd5044eec38dec482c.tar.xz
linux-dev-c25015c1184e7e54c02e0dfd5044eec38dec482c.zip
Staging: vt6655-6: shift wrap in hostap_set_encryption()
abySeq is an unsigned char so shifting more than 31 bits will lead to a shift wrapping bug. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/vt6656')
-rw-r--r--drivers/staging/vt6656/hostap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c
index 0a73d4060ee1..26a7d0e4b048 100644
--- a/drivers/staging/vt6656/hostap.c
+++ b/drivers/staging/vt6656/hostap.c
@@ -542,9 +542,9 @@ static int hostap_set_encryption(PSDevice pDevice,
if (param->u.crypt.seq) {
memcpy(&abySeq, param->u.crypt.seq, 8);
- for (ii = 0 ; ii < 8 ; ii++) {
- KeyRSC |= (abySeq[ii] << (ii * 8));
- }
+ for (ii = 0 ; ii < 8 ; ii++)
+ KeyRSC |= (unsigned long)abySeq[ii] << (ii * 8);
+
dwKeyIndex |= 1 << 29;
pMgmt->sNodeDBTable[iNodeIndex].KeyRSC = KeyRSC;
}