diff --git a/src/kit/shell/src/shellImport.c b/src/kit/shell/src/shellImport.c index cd8b06c91c71d8c08ae7ac362ee92719c6c05a08..347f99671db1bc9147c98d97ec708a3bf8bcf689 100644 --- a/src/kit/shell/src/shellImport.c +++ b/src/kit/shell/src/shellImport.c @@ -148,7 +148,11 @@ static void shellSourceFile(TAOS *con, char *fptr) { } char *fname = full_path.we_wordv[0]; - + if (fname == NULL) { + fprintf(stderr, "ERROR: invalid filename\n"); + return; + } + if (access(fname, F_OK) != 0) { fprintf(stderr, "ERROR: file %s is not exist\n", fptr);