[sr-dev] [kamailio] Kamailio crashes if i use $expires(max) (#495)

Fabio Margarido notifications at github.com
Thu Feb 4 13:22:31 CET 2016


Yeah, I read up no gdb's list command and this seems wrong. I've downloaded the kamailio source code via ```apt-get source``` and these are the lines around line 3060 in pv_core.c:

```c
3050         hdr = msg->contact;                                                                                                     
3051         while(hdr) {                                                                                                            
3052             if (hdr->type == HDR_CONTACT_T) {                                                                                   
3053                 if (!hdr->parsed && (parse_contact(hdr) < 0)) {                                                                 
3054                     LM_ERR("failed to parse Contact body\n");                                                                   
3055                     return pv_get_null(msg, param, res);                                                                        
3056                 }                                                                                                               
3057                 c = ((contact_body_t*)hdr->parsed)->contacts;                                                                   
3058                 while(c) {                                                                                                      
3059                     c = c->next;                                                                                                
3060                     if(c->expires && c->expires->body.len) {                                                                    
3061                         if (str2int(&c->expires->body, &eval) < 0) {                                                            
3062                             LM_ERR("failed to parse expires\n");                                                                
3063                             return pv_get_null(msg, param, res);                                                                
3064                         }                                                                                                       
3065                         efound = 1;                                                                                             
3066                         if(eval>exp_max) exp_max = eval;                                                                        
3067                         if(eval<exp_min) exp_min = eval;                                                                        
3068                     } else if(msg->expires && msg->expires->parsed) {                                                           
3069                         eval = ehdr;                                                                                            
3070                         efound = 1; 
```

Shouldn't ```c = c->next``` be at the end of the ```while``` loop?

---
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/495#issuecomment-179799530
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160204/31644024/attachment.html>


More information about the sr-dev mailing list