Merge pull request !1740 from LeiiYB/OpenHarmony-5.0-Release
This commit is contained in:
openharmony_ci 2024-09-26 05:37:18 +00:00 committed by Gitee
commit e6bf1445c9
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -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);