From 6b7055bb3750331616aaeb986b380dc8d050f525 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 27 Nov 2024 18:34:57 +0100 Subject: [PATCH] eq_f1ap_sys_info(): correct check a and b can only be equal if both NULL or both set (and all fields the same). Check for this. --- openair2/F1AP/lib/f1ap_lib_common.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openair2/F1AP/lib/f1ap_lib_common.c b/openair2/F1AP/lib/f1ap_lib_common.c index 2938898aff..2dc149a8be 100644 --- a/openair2/F1AP/lib/f1ap_lib_common.c +++ b/openair2/F1AP/lib/f1ap_lib_common.c @@ -81,6 +81,13 @@ bool eq_f1ap_cell_info(const f1ap_served_cell_info_t *a, const f1ap_served_cell_ bool eq_f1ap_sys_info(const f1ap_gnb_du_system_info_t *a, const f1ap_gnb_du_system_info_t *b) { + if (!a && !b) + return true; + + /* will fail if not both a/b NULL or set */ + if ((!a) ^ (!b)) + return false; + /* MIB */ _F1_EQ_CHECK_INT(a->mib_length, b->mib_length); for (int i = 0; i < a->mib_length; i++)