dect
/
asterisk
Archived
13
0
Fork 0

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/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@320505 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
jrose 2011-05-23 14:40:59 +00:00
parent 695a84cd48
commit 90da28ff05
1 changed files with 7 additions and 0 deletions

View File

@ -13589,6 +13589,13 @@ static int __set_address_from_contact(const char *fullcontact, struct ast_sockad
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);