瀏覽代碼

Check param before use

Serj Kalichev 10 年之前
父節點
當前提交
a592cf8486
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      clish/shell/shell_parse.c

+ 1 - 1
clish/shell/shell_parse.c

@@ -100,7 +100,7 @@ clish_pargv_status_t clish_shell_parse_pargv(clish_pargv_t *pargv,
 			arg = lub_argv__get_arg(argv, *idx);
 
 		/* Is parameter in "switch" mode? */
-		if (CLISH_PARAM_SWITCH == clish_param__get_mode(param))
+		if (param && (CLISH_PARAM_SWITCH == clish_param__get_mode(param)))
 			is_switch = 1;
 
 		/* Check the 'test' conditions */