Skip to content

Commit

Permalink
Staging: vt6655-6: shift wrap buf in s_vFillTxKey()
Browse files Browse the repository at this point in the history
byKeyIndex is an unsigned char between 0 and 0xf.  If it is any value
higher than 1, then we will hit an integer wrap issue here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Oct 22, 2012
1 parent f20fbdf commit ff4573a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/vt6655/rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ s_vFillTxKey (
}
// Append IV after Mac Header
*pdwIV &= WEP_IV_MASK;//00000000 11111111 11111111 11111111
*pdwIV |= (byKeyIndex << 30);
*pdwIV |= (unsigned long)byKeyIndex << 30;
*pdwIV = cpu_to_le32(*pdwIV);
pDevice->dwIVCounter++;
if (pDevice->dwIVCounter > WEP_IV_MASK) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/vt6656/rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ s_vFillTxKey (
}
// Append IV after Mac Header
*pdwIV &= WEP_IV_MASK;//00000000 11111111 11111111 11111111
*pdwIV |= (pDevice->byKeyIndex << 30);
*pdwIV |= (unsigned long)pDevice->byKeyIndex << 30;
*pdwIV = cpu_to_le32(*pdwIV);
pDevice->dwIVCounter++;
if (pDevice->dwIVCounter > WEP_IV_MASK) {
Expand Down

0 comments on commit ff4573a

Please sign in to comment.