From c5e524c5f987ade4d98f5d611960c69a5a428406 Mon Sep 17 00:00:00 2001 From: David Declerck Date: Thu, 26 Sep 2024 12:27:47 +0200 Subject: [PATCH] Fix for segault in check_argument_conformance --- cobc/ChangeLog | 5 +++++ cobc/typeck.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/cobc/ChangeLog b/cobc/ChangeLog index 91014b5db..114fae48c 100644 --- a/cobc/ChangeLog +++ b/cobc/ChangeLog @@ -1,4 +1,9 @@ +2024-09-26 Fabrice Le Fessant + + * typeck.c (check_argument_conformance): check that param is well defined + to prevent a segfault + 2024-09-25 Nicolas Berthier * typeck.c (cb_tree_is_numeric_ref_or_field) diff --git a/cobc/typeck.c b/cobc/typeck.c index 391ebaba5..fae6912ac 100644 --- a/cobc/typeck.c +++ b/cobc/typeck.c @@ -3603,6 +3603,9 @@ check_argument_conformance (struct cb_program *program, cb_tree argument_tripple } else { arg_field = NULL; } + if (!CB_FIELD_P(param)) { + return; + } param_field = CB_FIELD_PTR(CB_VALUE(param)); /*