From eff3cc6f5e8035eb6a5c9af19a990e307bd207d9 Mon Sep 17 00:00:00 2001 From: Dmitry Verenitsin Date: Wed, 4 Nov 2026 19:42:01 +0500 Subject: [PATCH] [core] Check for a missing To-Path before msrp_find_uuid() reads it `msrp_find_uuid()` called `strlen()` on the To-Path before asserting it was set, and a first SEND without a To-Path header passes NULL. Return `SWITCH_FALSE` for it, so the worker handles it like any To-Path that names no session. --- src/switch_msrp.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/switch_msrp.c b/src/switch_msrp.c index 5c8578be50..4bac62e283 100644 --- a/src/switch_msrp.c +++ b/src/switch_msrp.c @@ -1066,10 +1066,15 @@ switch_status_t msrp_report(switch_msrp_client_socket_t *csock, switch_msrp_msg_ static switch_bool_t msrp_find_uuid(char *uuid, const char *to_path) { - int len = strlen(to_path); + int len; int i; int slash_count = 0; - switch_assert(to_path); + + if (!to_path) { + return SWITCH_FALSE; + } + + len = strlen(to_path); for(i=0; i