Pārlūkot izejas kodu

Fix potential NULL dereference

Serj Kalichev 10 gadi atpakaļ
vecāks
revīzija
d812a914d7
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      lub/system/test.c

+ 3 - 0
lub/system/test.c

@@ -288,6 +288,9 @@ static int binop(void)
 	(void)t_lex(*++t_wp);
 	(void)t_lex(*++t_wp);
 	op = t_wp_op;
 	op = t_wp_op;
 
 
+	if (!op)
+		return 1;
+
 	if ((opnd2 = *++t_wp) == NULL)
 	if ((opnd2 = *++t_wp) == NULL)
 		syntax(op->op_text, "argument expected");
 		syntax(op->op_text, "argument expected");