代码优化修改

Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
fangyunzhong 2023-07-25 04:14:26 +00:00 committed by fyz1019
parent 206512dc42
commit 7503076342

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;