From e1879c07bc472a9e664b24686811089ad25719fc Mon Sep 17 00:00:00 2001 From: Bartosz Podrygajlo Date: Thu, 5 Sep 2024 15:21:07 +0200 Subject: [PATCH] Fix segfault when attempting to use unsupported scope types in nrscope Do not attempt to copy scope types >= MAX_SCOPE_TYPES in nrscope as it does not support them at this point. --- openair1/PHY/TOOLS/phy_scope_interface.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openair1/PHY/TOOLS/phy_scope_interface.c b/openair1/PHY/TOOLS/phy_scope_interface.c index 5b857312ba..70d3889b64 100644 --- a/openair1/PHY/TOOLS/phy_scope_interface.c +++ b/openair1/PHY/TOOLS/phy_scope_interface.c @@ -60,6 +60,9 @@ int end_forms(void) { void copyData(void *scopeData, enum scopeDataType type, void *dataIn, int elementSz, int colSz, int lineSz, int offset, metadata *meta) { + if (type >= MAX_SCOPE_TYPES) { + return; + } scopeData_t *tmp = (scopeData_t *)scopeData; if (tmp) {