Staging: vt6655: Correct unsigned bound issue
authorRoel Kluin <roel.kluin@gmail.com>
Fri, 16 Oct 2009 18:17:57 +0000 (20:17 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Dec 2009 20:23:16 +0000 (12:23 -0800)
uNodeIndex is unsigned, check whether it is within bounds instead.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/vt6655/wroute.c
drivers/staging/vt6656/rxtx.c

index ab991618a2983222e897bf67b3c4007320c0153e..1d02040e80e0496cb786cd678e2afd11a4976f13 100644 (file)
@@ -113,7 +113,7 @@ BOOL ROUTEbRelay (PSDevice pDevice, PBYTE pbySkbData, UINT uDataLen, UINT uNodeI
     }
 
     if (pDevice->bEnableHostWEP) {
-        if (uNodeIndex >= 0) {
+       if (uNodeIndex < MAX_NODE_NUM + 1) {
             pTransmitKey = &STempKey;
             pTransmitKey->byCipherSuite = pMgmt->sNodeDBTable[uNodeIndex].byCipherSuite;
             pTransmitKey->dwKeyIndex = pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex;
index 94ddf8bab62be9aa05bdb90dbe8c52da29f7574e..d9fa36c95230da95c61d3fcbd59b5a7680ef259c 100644 (file)
@@ -3153,7 +3153,7 @@ bRelayPacketSend (
     }
 
     if (pDevice->bEnableHostWEP) {
-        if (uNodeIndex >= 0) {
+        if (uNodeIndex < MAX_NODE_NUM + 1) {
             pTransmitKey = &STempKey;
             pTransmitKey->byCipherSuite = pMgmt->sNodeDBTable[uNodeIndex].byCipherSuite;
             pTransmitKey->dwKeyIndex = pMgmt->sNodeDBTable[uNodeIndex].dwKeyIndex;