From b756c173da051806c358fffccbfd915e04993e9e Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 4 Apr 2025 12:13:22 -0400 Subject: [PATCH] MT#55283 guard media_index against out of bounds NGCP-Flow: mr12.5 Change-Id: Ib52e0d0fc605dc3e58cdfc7b3a2d1a7c1aa1dbf7 --- daemon/sdp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 921e82710..efb80293a 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -3367,7 +3367,8 @@ int sdp_replace(struct sdp_chopper *chop, sdp_sessions_q *sessions, } err = "no matching media"; - call_media = monologue->medias->pdata[media_index]; + call_media = media_index < monologue->medias->len ? monologue->medias->pdata[media_index] + : NULL; if (!call_media) goto error; err = "no matching media stream";