From 64840179321a774d60864fbb4ac4319d53c217a1 Mon Sep 17 00:00:00 2001 From: Hongze Cheng Date: Sat, 3 Aug 2019 15:30:16 +0800 Subject: [PATCH] add command size check when source file --- src/kit/shell/src/shellEngine.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/kit/shell/src/shellEngine.c b/src/kit/shell/src/shellEngine.c index 1842a42f6c..ce1d41eec8 100644 --- a/src/kit/shell/src/shellEngine.c +++ b/src/kit/shell/src/shellEngine.c @@ -626,6 +626,7 @@ void source_file(TAOS *con, char *fptr) { } while ((read_len = getline(&line, &line_len, f)) != -1) { + if (read_len >= MAX_COMMAND_SIZE) continue; line[--read_len] = '\0'; if (read_len == 0 || isCommentLine(line)) { // line starts with # -- GitLab