mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-02 14:23:19 +08:00
[finsh][shell] Avoid prompt format-string injection
Agent-Logs-Url: https://github.com/RT-Thread/rt-thread/sessions/b514540d-90fa-4ac9-bb74-5c84dd939b40 Co-authored-by: BernardXiong <1241087+BernardXiong@users.noreply.github.com>
This commit is contained in:
co-authored by
BernardXiong
parent
8c7dbbb0a6
commit
1d4b45954b
@@ -542,7 +542,7 @@ static void finsh_thread_entry(void *parameter)
|
||||
finsh_wait_auth();
|
||||
#endif
|
||||
|
||||
rt_kprintf(FINSH_PROMPT);
|
||||
rt_kprintf("%s", FINSH_PROMPT);
|
||||
|
||||
while (1)
|
||||
{
|
||||
@@ -842,7 +842,7 @@ static void finsh_thread_entry(void *parameter)
|
||||
rt_kprintf("\n");
|
||||
msh_exec(shell->line, shell->line_position);
|
||||
|
||||
rt_kprintf(FINSH_PROMPT);
|
||||
rt_kprintf("%s", FINSH_PROMPT);
|
||||
rt_memset(shell->line, 0, sizeof(shell->line));
|
||||
shell->line_curpos = shell->line_position = 0;
|
||||
continue;
|
||||
@@ -1019,4 +1019,3 @@ int finsh_system_init(void)
|
||||
INIT_APP_EXPORT(finsh_system_init);
|
||||
|
||||
#endif /* RT_USING_FINSH */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user