Module: kamailio
Branch: master
Commit: 5d641f56fc1bc342d9be008ecd96959e114fef66
URL: 
https://github.com/kamailio/kamailio/commit/5d641f56fc1bc342d9be008ecd96959e114fef66

Author: Daniel-Constantin Mierla <mico...@gmail.com>
Committer: Daniel-Constantin Mierla <mico...@gmail.com>
Date: 2023-12-13T12:08:56+01:00

registrar: check returned branch pointer

---

Modified: src/modules/registrar/lookup.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/5d641f56fc1bc342d9be008ecd96959e114fef66.diff
Patch: 
https://github.com/kamailio/kamailio/commit/5d641f56fc1bc342d9be008ecd96959e114fef66.patch

---

diff --git a/src/modules/registrar/lookup.c b/src/modules/registrar/lookup.c
index fec1efe2e90..c0d1404a9e5 100644
--- a/src/modules/registrar/lookup.c
+++ b/src/modules/registrar/lookup.c
@@ -703,8 +703,9 @@ int lookup_branches(sip_msg_t *msg, udomain_t *d)
        for(i = 0; i < nr_branches_start; i++) {
                crt = get_sip_branch(i);
                /* it has to be a clean branch to do lookup for it */
-               if(crt->len <= 0 || crt->dst_uri_len > 0 || crt->path_len > 0
-                               || crt->force_send_socket != NULL || crt->flags 
!= 0)
+               if(crt == NULL || crt->len <= 0 || crt->dst_uri_len > 0
+                               || crt->path_len > 0 || crt->force_send_socket 
!= NULL
+                               || crt->flags != 0)
                        continue;
                /* set the new uri from branch and lookup */
                new_uri.s = crt->uri;

_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to