!411 【OpenHarmony-4.0-Beta2 】[Bug]: 稳定性问题,代码优化修改

Merge pull request !411 from fyz1019/cherry-pick-1690457676
This commit is contained in:
openharmony_ci 2023-07-28 04:37:09 +00:00 committed by Gitee
commit bd536e27b0
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -339,7 +339,7 @@ int32_t ParseString(const char *buffer, uint32_t &offset, std::string &id, bool
{
uint16_t strLen;
errno_t eret = memcpy_s(&strLen, sizeof(strLen), buffer + offset, 2);
if (eret != OK) {
if (eret != OK || (includeTemi && strLen == 0)) {
return SYS_ERROR;
}
offset += 2;