diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-10-11 06:55:25 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-22 20:26:40 (GMT) |
commit | c25015c1184e7e54c02e0dfd5044eec38dec482c (patch) | |
tree | 8d2158d00b6c10e6dcf2ec6083e6562ebca97c84 /drivers/staging/vt6656 | |
parent | ff4573a7afc53ccf6c66622b884d60208d04db2b (diff) | |
download | linux-fsl-qoriq-c25015c1184e7e54c02e0dfd5044eec38dec482c.tar.xz |
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.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c index 0a73d40..26a7d0e 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; } |