From ddc188bcd049220dfa73a090bb23ed5451a9907e Mon Sep 17 00:00:00 2001 From: Bastian Triller Date: Thu, 15 Dec 2022 10:48:40 +0100 Subject: [PATCH] sanity: Prevent segfault For star Contacts, there are no URIs that can be checked. (cherry picked from commit f1bac3433c61b0a5b4be08e7738a3a1aa0defe73) (cherry picked from commit ee9cbc7585fb645bfa7117f8cd5122f3ae260d57) --- src/modules/sanity/sanity.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/sanity/sanity.c b/src/modules/sanity/sanity.c index 55a8051a985..0c250af279e 100644 --- a/src/modules/sanity/sanity.c +++ b/src/modules/sanity/sanity.c @@ -820,7 +820,8 @@ int check_parse_uris(sip_msg_t* msg, int checks) { } return SANITY_CHECK_FAILED; } - if (parse_uri( + if (!((struct contact_body*)msg->contact->parsed)->star + && parse_uri( ((struct contact_body*)msg->contact->parsed)->contacts->uri.s, ((struct contact_body*)msg->contact->parsed)->contacts->uri.len, &uri) != 0) {