[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.
This commit is contained in:
Dmitry Verenitsin committed 2026-11-18 22:36:36 +05:00
1 parent 93fe4cc929
commit eff3cc6f5e
1 file changed
+7 -2
+7 -2
View File
@@ -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<len; i++){
if (*(to_path + i) == '/') {
if (++slash_count == 3) break;