From 6e25c0bc918464b03fd7a633af382f39ae3b4d6f Mon Sep 17 00:00:00 2001 From: Dragos Oancea Date: Wed, 31 May 2023 15:51:14 +0300 Subject: [PATCH] [mod_sofia] coverity CID 1024750 (Dereference null return value) --- src/mod/endpoints/mod_sofia/sofia.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index f14b574adf..c5b5bcc190 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -2818,7 +2818,10 @@ void event_handler(switch_event_t *event) if ((sptr = strstr(fixed_contact_str, needle))) { char *origsptr = strstr(contact_str, needle); - eptr = strchr(++origsptr, ';'); + + if (origsptr) { + eptr = strchr(++origsptr, ';'); + } } else { sptr = strchr(fixed_contact_str, '\0') - 1; }