[HUST CSE] for循环判断条件出错字符串读取越界 (#7352)

This commit is contained in:
szlr 2023-04-26 09:15:31 +08:00 committed by GitHub
parent c2ac614c59
commit 90853abb08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -399,7 +399,7 @@ static rt_err_t at_cmd_get_name(const char *cmd_buffer, char *cmd_name)
RT_ASSERT(cmd_name);
RT_ASSERT(cmd_buffer);
for (i = 0; i < strlen(cmd_buffer) + 1; i++)
for (i = 0; i < strlen(cmd_buffer); i++)
{
if (*(cmd_buffer + i) == AT_CMD_QUESTION_MARK || *(cmd_buffer + i) == AT_CMD_EQUAL_MARK
|| *(cmd_buffer + i) == AT_CMD_CR