[Serdev] Fix for registrar module in ser-0.9.3 when no expires
header exists
Evan Borgström
evan.borgstrom at ca.mci.com
Thu Jun 16 20:12:57 UTC 2005
Actually scratch that. After 3 days of this not crashing I just got the
client to crash the proxy again (of course right after I sent this). I
guess I'll need to dig a little deeper. I was hoping it would be nice
and easy, back to re-compiling with memory debugging on ;)
FYI, here's the message that did it (IP's changed & Auth header removed).
#
U 2005/06/16 16:08:19.936258 1.2.3.4:9404 -> 2.3.4.5:5060
REGISTER sip:ca.mci.com;transport=udp SIP/2.0.
To: Evan Borgstrom<sip:evanb at ca.mci.com>.
From: Evan Borgstrom<sip:evanb at ca.mci.com>;tag=485a6c68.
Via: SIP/2.0/UDP
142.77.11.120:9404;branch=z9hG4bK-d87543-581252137-1--d87543-;rport.
Call-ID: 4a5c921cef51cd5e.
CSeq: 3 REGISTER.
Contact: <sip:evanb at 1.2.3.4:9404;transport=udp>;expires=0.
Max-Forwards: 70.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE,
SUBSCRIBE, INFO.
User-Agent: MCI eyeBeam release 9100a stamp 17191.
Authorization: Digest ...
Content-Length: 0.
-Evan
Evan Borgström wrote:
>
> Attached is a fix for the registrar module that fixes REGISTER
> packets meant to de-register but that contain only an ;expires tag in
> the contact and no Expires: header.
>
> When clients would send a REGISTER packet without the Expires header
> but that had an ;expires=0 in the contact list SER would crash and
> eventually put a "BUG: qm_free" message to the debug logs then exit.
>
>
> -Evan
>
>
> ------------------------------------------------------------------------
>
> --- ser-0.9.3.orig/modules/registrar/sip_msg.c 2005-06-14 11:47:34.000000000 -0400
> +++ ser-0.9.3/modules/registrar/sip_msg.c 2005-06-14 11:56:39.000000000 -0400
> @@ -98,10 +98,14 @@
> return -4;
> }
>
> - if (_m->expires && !_m->expires->parsed && (parse_expires(_m->expires) < 0)) {
> - rerrno = R_PARSE_EXP;
> - LOG(L_ERR, "parse_message(): Error while parsing expires body\n");
> - return -5;
> + if (_m->expires) {
> + if (!_m->expires->parsed && (parse_expires(_m->expires) < 0)) {
> + rerrno = R_PARSE_EXP;
> + LOG(L_ERR, "parse_message(): Error while parsing expires body\n");
> + return -5;
> + }
> + } else {
> + _m->expires = 0;
> }
>
> if (_m->contact) {
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Serdev mailing list
> serdev at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serdev
More information about the Serdev
mailing list