add command size check when source file

This commit is contained in:
Hongze Cheng 2019-08-03 15:30:16 +08:00
parent 3b12b32560
commit 6484017932
1 changed files with 1 additions and 0 deletions

View File

@ -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 #