[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sr-dev
Subject:    Re: [Serdev] modules/auth_db v1.19 still seg faults
From:       Daniel-Constantin Mierla <Daniel-Constantin.Mierla () fokus ! fraunhofer ! de>
Date:       2004-10-29 20:31:02
Message-ID: 4182A886.5010801 () fokus ! fraunhofer ! de
[Download RAW message or body]

Paul,
that makes sense, it should be checked also for int values ... (block
starting with line 231 not to allow strange values due to no
initialization). Worth to check if the mysql module fills the result
structures with 0 -- seems not to do it, it may be a result of the MySQL
client library. Jan should know better, he is the maintainer of mysql
and auth_db modules, but he is very busy/travelling in last period.

Another way around will be to set the default values to empty string ""
and to 0 for these columns, I am afraid that there are many modules not
checking the nul flag but relying on non-NULL default values.

If no one will volunteer by tomorrow I will try to fix it during the
weekend.


Thanks,
Daniel

On 10/29/04 22:03, Java Rockx wrote:

>Daniel,
>
>This patch seems to work. Can you see if it makes sense as I'm still trying to
>get my mind around ser's source code.
>
>
>All I'm doing where is testing the database row for NULL and continuing if it
>is NULL.
>
>Regards,
>Paul
>
>
>--- authorize.c 2004-10-29 15:58:24.000000000 -0400
>+++ sip_router/modules/auth_db/authorize.c      2004-10-29 16:00:08.000000000
>-0400
>@@ -214,6 +214,8 @@
>                for (i = 0; i < avps_str_n; i++) {
>                        if (avps_str[i].len != 4 || memcmp(avps_str[i].s,
>"rpid", 4) != 0)
>                                continue;
>+                       if ((result->rows[0].values[1 + avps_int_n + i]).nul ==
>1)
>+                               continue;
>                        rpid.s = (char*)VAL_STRING(&(result->rows[0].values[1 +
>avps_int_n + i]));
>                        if(rpid.s!=NULL)
>                                rpid.len = strlen(rpid.s);
>@@ -235,6 +237,8 @@
>                                    iname.s->len, ZSW(iname.s->s), ivalue.n);
>                        }
>                        for (i = 0; i < avps_str_n; i++) {
>+                               if ((result->rows[0].values[1 + avps_int_n +
>i]).nul == 1)
>+                                       continue;
>                                value.s =
>(char*)VAL_STRING(&(result->rows[0].values[1 + avps_int_n + i]));
>                                if(value.s==NULL)
>                                        continue;
>
>
>
>
>
>--- Daniel-Constantin Mierla <Daniel-Constantin.Mierla@fokus.fraunhofer.de>
>wrote:
>
>  
>
>>could you check again the latest CVS version? I have just committed 
>>another fix, but I have no proper environment to do the tests yet.
>>
>>Thanks,
>>Daniel
>>
>>On 10/29/04 19:48, Java Rockx wrote:
>>
>>    
>>
>>>Hi All. 
>>>
>>>I pulled modules/auth_db/authorize.c version 1.19 this morning and it
>>>still segfaults. Below is the revalent portion of the core dump. If you need
>>>the full core dump then let me know.
>>>
>>>Regards,
>>>Paul
>>>
>>>CORE DUMP FROM authorize.c version 1.19
>>>
>>>#0  0xb72fa1f4 in authorize (_m=0x80ffbb8, _realm=0x0, _table=0x0,
>>>      
>>>
>>_hftype=0)
>>    
>>
>>>at authorize.c:241
>>>241                                             value.len = strlen(value.s);
>>>(gdb) bt
>>>#0  0xb72fa1f4 in authorize (_m=0x80ffbb8, _realm=0x0, _table=0x0,
>>>      
>>>
>>_hftype=0)
>>    
>>
>>>at authorize.c:241
>>>#1  0xb72f9c97 in www_authorize (_m=0x0, _realm=0x0, _table=0x0) at
>>>authorize.c:275
>>>#2  0x0804ef2a in do_action (a=0x80f8690, msg=0x80ffbb8) at action.c:609
>>>#3  0x0805069c in run_actions (a=0x80f8690, msg=0x80ffbb8) at action.c:707
>>>#4  0x0806d59d in eval_elem (e=0x80f86b8, msg=0x80f8690) at route.c:574
>>>#5  0x0806bd9c in eval_expr (e=0x80f86b8, msg=0x80ffbb8) at route.c:623
>>>#6  0x0806bd6f in eval_expr (e=0x80f86d8, msg=0x80ffbb8) at route.c:639
>>>#7  0x0804ee13 in do_action (a=0x80f88e0, msg=0x80ffbb8) at action.c:585
>>>#8  0x0805069c in run_actions (a=0x80f88e0, msg=0x80ffbb8) at action.c:707
>>>#9  0x0804ee49 in do_action (a=0x80f8b80, msg=0x80ffbb8) at action.c:599
>>>#10 0x0805069c in run_actions (a=0x80f8b80, msg=0x80ffbb8) at action.c:707
>>>#11 0x08069059 in receive_msg (
>>>   buf=0x80be1a0 "REGISTER sip:sip.mycompany.com SIP/2.0\r\nVia:
>>>      
>>>
>>SIP/2.0/UDP
>>    
>>
>>>192.168.0.83;branch=z9hG4bKb2da6bfeba43c517\r\nFrom: \"Paul (1002)\"
>>><sip:1002@sip.mycompany.com;user=phone>;tag=08195ca2144c988d\r\nTo:
>>><sip:1002@sip.myco"..., len=684, rcv_info=0xbfffb690) at receive.c:165
>>>#12 0x080795fc in udp_rcv_loop () at udp_server.c:458
>>>#13 0x0805b2f4 in main_loop () at main.c:910
>>>#14 0x0805c6c5 in main (argc=5, argv=0xb52ab1d8) at main.c:1443
>>>
>>>
>>>
>>>		
>>>__________________________________
>>>Do you Yahoo!?
>>>Yahoo! Mail Address AutoComplete - You start. We finish.
>>>http://promotions.yahoo.com/new_mail 
>>>
>>>_______________________________________________
>>>Serdev mailing list
>>>serdev@lists.iptel.org
>>>http://lists.iptel.org/mailman/listinfo/serdev
>>>
>>> 
>>>
>>>      
>>>
>
>
>
>		
>__________________________________
>Do you Yahoo!?
>Read only the mail you want - Yahoo! Mail SpamGuard.
>http://promotions.yahoo.com/new_mail 
>
>  
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic