From a4be66b9b040ece87727a2999565f20722ba1370 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Tue, 22 Jun 2021 00:19:43 +0200 Subject: [PATCH] Prevent crash if there is bad syntax in h, g, e, or f line --- src/frontend/inpcom.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index bef126e7c..498ff83b9 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -9671,8 +9671,11 @@ static int inp_poly_2g6_compat(struct card* deck) { curr_line = nexttok_noparens(curr_line); curr_line = nexttok_noparens(curr_line); curr_line = nexttok_noparens(curr_line); - if (!curr_line) + if (!curr_line) { + fprintf(stderr, "Error: bad syntax of line\n %s\n", thisline); + fprintf(stderr, "No circuit loaded!\n"); return 1; + } /* exclude all of the following fourth tokens */ if (ciprefix("poly", curr_line)) continue;