Browse code

bb5224: fix dereference of a null pointer reported by clang analyzer

Steve Morgan authored on 2012/11/10 07:08:50
Showing 1 changed files
... ...
@@ -1166,7 +1166,7 @@ static int cli_scanscript(cli_ctx *ctx)
1166 1166
 	text_normalize_init(&state, normalized, SCANBUFF + maxpatlen);
1167 1167
 	ret = CL_CLEAN;
1168 1168
 
1169
-	if ((ret = cli_ac_initdata(&tmdata, troot->ac_partsigs, troot->ac_lsigs, troot->ac_reloff_num, CLI_DEFAULT_AC_TRACKLEN))) 
1169
+	if ((ret = cli_ac_initdata(&tmdata, troot?troot->ac_partsigs:0, troot?troot->ac_lsigs:0, troot?troot->ac_reloff_num:0, CLI_DEFAULT_AC_TRACKLEN))) 
1170 1170
 	    return ret;
1171 1171
 
1172 1172
 	if ((ret = cli_ac_initdata(&gmdata, groot->ac_partsigs, groot->ac_lsigs, groot->ac_reloff_num, CLI_DEFAULT_AC_TRACKLEN))) {