[asterisk-commits] jrose: trunk r320505 - in /trunk: ./ channels/chan_sip.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Mon May 23 09:41:10 CDT 2011
Author: jrose
Date: Mon May 23 09:40:59 2011
New Revision: 320505
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=320505
Log:
Merged revisions 320504 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
........
r320504 | jrose | 2011-05-23 09:33:20 -0500 (Mon, 23 May 2011) | 10 lines
Fixes segfault occuring in chan_sip.c at __set_address_from_contact
Checks to see if domain contains anything before sending it off to ast_sockaddr_resolve
which is where the segfault was occuring due to null str.
(closes issue #18857)
Reported by: sybasesql
Review: https://reviewboard.asterisk.org/r/1225/
........
Modified:
trunk/ (props changed)
trunk/channels/chan_sip.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.
Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=320505&r1=320504&r2=320505
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon May 23 09:40:59 2011
@@ -13589,6 +13589,13 @@
assume that the domain part is a host name and only look for an A/AAAA record in DNS.
*/
+ /* If we took in an invalid URI, domain may not have been initialized */
+ /* ast_sockaddr_resolve requires an initialized domain string. */
+ if (ast_strlen_zero(domain)) {
+ ast_log(LOG_WARNING, "Invalid URI: parse_uri failed to acquire domain\n");
+ return -1;
+ }
+
if (ast_sockaddr_resolve_first(addr, domain, 0)) {
ast_log(LOG_WARNING, "Invalid host name in Contact: (can't "
"resolve in DNS) : '%s'\n", domain);
More information about the asterisk-commits
mailing list