Module: kamailio
Branch: master
Commit: 7231be0785009cb17581822f0765985eb7bdb243
URL: 
https://github.com/kamailio/kamailio/commit/7231be0785009cb17581822f0765985eb7bdb243

Author: Daniel-Constantin Mierla <[email protected]>
Committer: Daniel-Constantin Mierla <[email protected]>
Date: 2021-04-14T12:52:58+02:00

seas: check when walking the list

---

Modified: src/modules/seas/seas_action.c

---

Diff:  
https://github.com/kamailio/kamailio/commit/7231be0785009cb17581822f0765985eb7bdb243.diff
Patch: 
https://github.com/kamailio/kamailio/commit/7231be0785009cb17581822f0765985eb7bdb243.patch

---

diff --git a/src/modules/seas/seas_action.c b/src/modules/seas/seas_action.c
index cd62848ab0..83be6307d0 100644
--- a/src/modules/seas/seas_action.c
+++ b/src/modules/seas/seas_action.c
@@ -1329,8 +1329,12 @@ int extract_allowed_headers(struct sip_msg *my_msg,int 
strip_top_vias,int allow_
         }else{
            assert(rtcnt>0);
            rb=hf->parsed;
-           while(--rtcnt)
+           while(rb && --rtcnt)
               rb=rb->next;
+               if(!rb) {
+                       LM_ERR("no rr\n");
+                       goto error;
+               }
            k= (((rb->nameaddr.name.s) + rb->len)-hf->name.s) ;
            if(len+k+CRLF_LEN<headers_len){
               memcpy(headers+len,hf->name.s,k);


_______________________________________________
Kamailio (SER) - Development Mailing List
[email protected]
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev

Reply via email to