[fix](function)fix string split function buffer overflow (#12834)

This commit is contained in:
starocean999
2022-09-24 17:32:00 +08:00
committed by GitHub
parent f1a64ea09f
commit dd6ed5a9a7

View File

@ -1013,7 +1013,7 @@ public:
int32_t num = 0;
while (num < part_number) {
pre_offset = offset;
size_t n = str.size - offset;
size_t n = str.size - offset - 1;
const char* pos = reinterpret_cast<const char*>(
memchr(str.data + offset + 1, delimiter_str[0], n));
if (pos != nullptr) {