mirror of
https://gitee.com/openharmony/distributeddatamgr_relational_store
synced 2024-11-27 01:01:02 +00:00
fix bug
Signed-off-by: leiiyb <leiyanbo@huawei.com>
This commit is contained in:
parent
c95223f670
commit
b07894f7dc
@ -163,7 +163,7 @@ size_t RawDataParser::ParserRawData(const uint8_t* data, size_t length, BigInteg
|
||||
uint64_t count = Endian::LeToH(*(reinterpret_cast<const uint64_t *>(alignData + used)));
|
||||
used += sizeof(uint64_t);
|
||||
|
||||
if (sizeof(uint64_t) * count > length - used) {
|
||||
if (count > (length - used) / sizeof(uint64_t)) {
|
||||
return 0;
|
||||
}
|
||||
const uint64_t *temp = (reinterpret_cast<const uint64_t *>(alignData + used));
|
||||
@ -201,7 +201,7 @@ size_t RawDataParser::ParserRawData(const uint8_t* data, size_t length, RawDataP
|
||||
uint32_t count = Endian::LeToH(*(reinterpret_cast<const uint32_t *>(alignData + used)));
|
||||
used += sizeof(uint32_t);
|
||||
|
||||
if (sizeof(float) * count > length - used) {
|
||||
if (count > (length - used) / sizeof(float)) {
|
||||
return 0;
|
||||
}
|
||||
auto values = reinterpret_cast<const float *>(alignData + used);
|
||||
|
Loading…
Reference in New Issue
Block a user