Module: sip-router
Branch: 3.3
Commit: ee62d8542dbc6f9391e59018560e17a0459e7a64
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ee62d85…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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)
(cherry picked from commit fc410ae69c6b371538f457947fd3a2946dc492cd)
---
modules_k/registrar/reply.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/modules_k/registrar/reply.c b/modules_k/registrar/reply.c
index e403889..226d29d 100644
--- a/modules_k/registrar/reply.c
+++ b/modules_k/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;