From ee93e1971dc2dbc3133962b3d914b18d7c93a681 Mon Sep 17 00:00:00 2001 From: Roel Kluin Date: Fri, 16 Oct 2009 20:17:57 +0200 Subject: [PATCH] Staging: vt6655: Correct unsigned bound issue uNodeIndex is unsigned, check whether it is within bounds instead. Signed-off-by: Roel Kluin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vt6655/wroute.c | 2 +- drivers/staging/vt6656/rxtx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/vt6655/wroute.c b/drivers/staging/vt6655/wroute.c index ab991618a298..1d02040e80e0 100644 --- a/drivers/staging/vt6655/wroute.c +++ b/drivers/staging/vt6655/wroute.c @@ -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; diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 94ddf8bab62b..d9fa36c95230 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -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; -- 2.20.1