未验证 提交 5158c9ad 编写于 作者: O openharmony_ci 提交者: Gitee

!552 【轻量级 PR】:修复数组越界

Merge pull request !552 from 熊磊/N/A
......@@ -195,7 +195,7 @@ int SplitString(char *srcPtr, const char *del, char **dstPtr, int maxNum)
char *buf = NULL;
dstPtr[0] = strtok_r(srcPtr, del, &buf);
int counter = 0;
while (dstPtr[counter] != NULL && (counter < maxNum)) {
while ((counter < maxNum) && (dstPtr[counter] != NULL)) {
counter++;
if (counter >= maxNum) {
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册