Browse code

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)

Daniel-Constantin Mierla authored on 20/09/2013 09:15:16
Showing 1 changed files
... ...
@@ -110,7 +110,7 @@ static inline unsigned int calc_buf_len(ucontact_t* c, str *host, int mode)
110 110
 			qlen = len_q(c->q);
111 111
 			if (qlen) len += Q_PARAM_LEN + qlen;
112 112
 			len += EXPIRES_PARAM_LEN + INT2STR_MAX_LEN;
113
-			if (c->received.s) {
113
+			if (rcv_param.len>0 && c->received.s) {
114 114
 				len += 1 /* ; */ 
115 115
 					+ rcv_param.len 
116 116
 					+ 1 /* = */ 
... ...
@@ -251,7 +251,7 @@ int build_contact(sip_msg_t *msg, ucontact_t* c, str *host)
251 251
 			memcpy(p, cp, len);
252 252
 			p += len;
253 253
 
254
-			if (c->received.s) {
254
+			if (rcv_param.len>0 && c->received.s) {
255 255
 				*p++ = ';';
256 256
 				memcpy(p, rcv_param.s, rcv_param.len);
257 257
 				p += rcv_param.len;