From: Automerge script Date: Thu, 12 Jul 2012 19:23:39 +0000 (+0000) Subject: Merged revisions 369994 via svnmerge from X-Git-Tag: 10.8.0-digiumphones-rc1~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=825c3eaf2b898b7cf5106c8bdc4117c6511fe393;p=thirdparty%2Fasterisk.git Merged revisions 369994 via svnmerge from file:///srv/subversion/repos/asterisk/branches/10 ................ r369994 | kmoore | 2012-07-12 13:55:17 -0500 (Thu, 12 Jul 2012) | 12 lines Prevent double uri_escaping in chan_sip when pedantic is enabled If pedantic mode is enabled, outbound invites will have double-escaped contacts. This avoids setting an already-escaped string into a field where it is expected to be unescaped. (closes issue ASTERISK-20023) Reported-by: Walter Doekes ........ Merged revisions 369993 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10-digiumphones@370013 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 40e674dbd8..ca2d1f0196 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -12502,18 +12502,18 @@ static void initreqprep(struct sip_request *req, struct sip_pvt *p, int sipmetho else /* Save for any further attempts */ ast_string_field_set(p, fromname, n); + ast_copy_string(tmp_l, l, sizeof(tmp_l)); if (sip_cfg.pedanticsipchecking) { ast_escape_quoted(n, tmp_n, sizeof(tmp_n)); n = tmp_n; ast_uri_encode(l, tmp_l, sizeof(tmp_l), ast_uri_sip_user); - l = tmp_l; } ourport = (p->fromdomainport) ? p->fromdomainport : ast_sockaddr_port(&p->ourip); if (!sip_standard_port(p->socket.type, ourport)) { - snprintf(from, sizeof(from), "\"%s\" ;tag=%s", n, l, d, ourport, p->tag); + snprintf(from, sizeof(from), "\"%s\" ;tag=%s", n, tmp_l, d, ourport, p->tag); } else { - snprintf(from, sizeof(from), "\"%s\" ;tag=%s", n, l, d, p->tag); + snprintf(from, sizeof(from), "\"%s\" ;tag=%s", n, tmp_l, d, p->tag); } if (!ast_strlen_zero(explicit_uri)) {