From 6c25d88f143c3e46b25bb2477db732821f45e766 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Mon, 10 Mar 2025 11:54:18 +0800 Subject: [PATCH] fix: scanf set length from 128 to 255 --- tests/army/cmdline/taosCli.py | 6 +++--- tools/shell/src/shellArguments.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/army/cmdline/taosCli.py b/tests/army/cmdline/taosCli.py index 804f680c85..179dfb6831 100644 --- a/tests/army/cmdline/taosCli.py +++ b/tests/army/cmdline/taosCli.py @@ -226,13 +226,13 @@ class TDTestCase(TBase): tdSql.execute(sql) cmds = [ - f"-udkj -p{pwd} -s show databases;", # command pass - f"-udkj -p < {pwdFile} -s show databases;" # input pass + f"-udkj -p{pwd} -s 'show databases;'", # command pass + f"-udkj -p < {pwdFile} -s 'show databases;'" # input pass ] for cmd in cmds: rlist = self.taos(cmd) - self.checkListString("Query OK,") + self.checkListString(rlist, "Query OK,") # run def run(self): diff --git a/tools/shell/src/shellArguments.c b/tools/shell/src/shellArguments.c index 93381b4f51..0c5a11d3b5 100644 --- a/tools/shell/src/shellArguments.c +++ b/tools/shell/src/shellArguments.c @@ -337,7 +337,7 @@ static void shellInitArgs(int argc, char *argv[]) { if (strlen(argv[i]) == 2) { printf("Enter password: "); taosSetConsoleEcho(false); - if (scanf("%128s", shell.args.password) > 1) { + if (scanf("%255s", shell.args.password) > 1) { fprintf(stderr, "password reading error\n"); } taosSetConsoleEcho(true);