From a164623fa3be3cc4617f6c122b9b1a4838dbeb4d Mon Sep 17 00:00:00 2001 From: francescomani Date: Thu, 27 Mar 2025 09:52:55 +0100 Subject: [PATCH] prevent access to NULL pointer in RELEASE_IE_FROMLIST --- common/utils/oai_asn1.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/utils/oai_asn1.h b/common/utils/oai_asn1.h index 0f202bf699..4d7ea6c73f 100644 --- a/common/utils/oai_asn1.h +++ b/common/utils/oai_asn1.h @@ -78,6 +78,10 @@ // Prints an error if ID not found in list. #define RELEASE_IE_FROMLIST(SOURCE, TARGET, FIELD) \ do { \ + if (!TARGET) { \ + LOG_E(NR_MAC, "Target list not present, impossible to release element\n"); \ + break; \ + } \ for (int iI = 0; iI < SOURCE->list.count; iI++) { \ long eL = *SOURCE->list.array[iI]; \ int iJ; \