Module: sip-router Branch: 4.0 Commit: fc410ae69c6b371538f457947fd3a2946dc492cd URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=fc410ae6...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: Fri Sep 20 11:15:16 2013 +0200
registrar: if rcv_parm value is empty, don't add received to contacts in 200ok reply
- otherwise results in malformed value
(cherry picked from commit 2f213e313a86e16665f6d0acfec959bf23f72b7d)
---
modules/registrar/reply.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules/registrar/reply.c b/modules/registrar/reply.c index 4b35a47..9d1bdfc 100644 --- a/modules/registrar/reply.c +++ b/modules/registrar/reply.c @@ -110,7 +110,7 @@ static inline unsigned int calc_buf_len(ucontact_t* c, str *host, int mode) qlen = len_q(c->q); if (qlen) len += Q_PARAM_LEN + qlen; len += EXPIRES_PARAM_LEN + INT2STR_MAX_LEN; - if (c->received.s) { + if (rcv_param.len>0 && c->received.s) { len += 1 /* ; */ + rcv_param.len + 1 /* = */ @@ -251,7 +251,7 @@ int build_contact(sip_msg_t *msg, ucontact_t* c, str *host) memcpy(p, cp, len); p += len;
- if (c->received.s) { + if (rcv_param.len>0 && c->received.s) { *p++ = ';'; memcpy(p, rcv_param.s, rcv_param.len); p += rcv_param.len;