mirror of
https://gitee.com/openharmony/developtools_hdc
synced 2024-11-23 23:20:43 +00:00
oob read
Signed-off-by: liuwei <liuwei573@huawei.com>
This commit is contained in:
parent
c01ad113c2
commit
154421891a
@ -621,9 +621,9 @@ bool HdcTransferBase::RecvIOPayload(CtxFile *context, uint8_t *data, int dataSiz
|
||||
SerialStruct::ParseFromString(pld, serialString);
|
||||
int clearSize = 0;
|
||||
StartTraceScope("HdcTransferBase::RecvIOPayload");
|
||||
if (pld.compressSize <= 0 || pld.compressSize > MAX_SIZE_IOBUF ||
|
||||
pld.uncompressSize <= 0 || pld.uncompressSize > MAX_SIZE_IOBUF) {
|
||||
WRITE_LOG(LOG_FATAL, "RecvIOPayload recv data size is illegal. pld.compressSize = %d", pld.compressSize);
|
||||
if (pld.compressSize <= 0 || pld.compressSize > dataSize ||
|
||||
pld.uncompressSize <= 0 || pld.uncompressSize > dataSize) {
|
||||
WRITE_LOG(LOG_FATAL, "compress size is greater than the dataSize. pld.compressSize = %d", pld.compressSize);
|
||||
return false;
|
||||
}
|
||||
if (pld.compressSize > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user