mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-16 22:38:41 +08:00
nshlib:judge whether nsh login username is a valid input
Signed-off-by: huangjian <huangjian@xiaomi.com>
This commit is contained in:
@@ -178,6 +178,12 @@ int nsh_login(FAR struct console_stdio_s *pstate)
|
||||
nsh_token(pstate, username, sizeof(username));
|
||||
}
|
||||
|
||||
if (username[0] == '\0')
|
||||
{
|
||||
i--;
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NSH_PLATFORM_CHALLENGE
|
||||
platform_challenge(challenge, sizeof(challenge));
|
||||
fputs(challenge, pstate->cn_outstream);
|
||||
|
Reference in New Issue
Block a user