summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Dutt <usdutt@codeaurora.org>2021-03-02 01:13:34 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2021-04-01 21:46:31 -0700
commitd6f61ebd80b698f20610ca466de1c9a03795d7b0 (patch)
tree03187c54edb8ba256ff2eeaeed80ef92ceecf39a
parent717f58316141d70b369cd6c974ff1a6e7c395f42 (diff)
Type cast to correct data type for comparision in NANTLV_ReadTlv
pOutTlv->length is of type u16 while the inBufferSize is int. The comparision between these different types is incorrect. Hence, Type cast to correct data type for comparision in NANTLV_ReadTlv. Change-Id: I72f96622f1264777e6f66ed8962b99369498c873 CRs-fixed: 2884038
-rw-r--r--qcwcn/wifi_hal/nan.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qcwcn/wifi_hal/nan.cpp b/qcwcn/wifi_hal/nan.cpp
index 2428e1d..e2d493e 100644
--- a/qcwcn/wifi_hal/nan.cpp
+++ b/qcwcn/wifi_hal/nan.cpp
@@ -1425,7 +1425,7 @@ u16 NANTLV_ReadTlv(u8 *pInTlv, pNanTlv pOutTlv, int inBufferSize)
pOutTlv->length |= *pInTlv++ << 8;
readLen += 2;
- if(pOutTlv->length > inBufferSize - NAN_TLV_HEADER_SIZE) {
+ if(pOutTlv->length > (u16)(inBufferSize - NAN_TLV_HEADER_SIZE)) {
ALOGE("Insufficient length to process TLV header, inBufferSize = %d",
inBufferSize);
return readLen;