[asterisk-commits] rmudgett: branch 10 r343852 - in /branches/10: ./ channels/chan_sip.c main/acl.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 8 12:01:16 CST 2011


Author: rmudgett
Date: Tue Nov  8 12:01:11 2011
New Revision: 343852

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=343852
Log:
Fixed reference to incorrect variable if unknown host configured crash.

* Fixed a LOG_ERROR message referencing the config variable list v that
had previously been processed and became NULL.

* Added error return value set that was missing in an ast_append_ha()
error return path.

(closes issue ASTERISK-18743)
Reported by: Michele
Patches:
      issueA18743-fix_dynamic_exclude_static_bad_host_log.patch (license #5674) patch uploaded by Walter Doekes
Tested by: Michele
........

Merged revisions 343851 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/channels/chan_sip.c
    branches/10/main/acl.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/channels/chan_sip.c?view=diff&rev=343852&r1=343851&r2=343852
==============================================================================
--- branches/10/channels/chan_sip.c (original)
+++ branches/10/channels/chan_sip.c Tue Nov  8 12:01:11 2011
@@ -28048,11 +28048,11 @@
 		ast_string_field_set(peer, tohost, srvlookup);
 
 		if (global_dynamic_exclude_static) {
-			int err = 0;
+			int ha_error = 0;
 			sip_cfg.contact_ha = ast_append_ha("deny", ast_sockaddr_stringify_addr(&peer->addr), 
-							sip_cfg.contact_ha, &err);
-			if (err) {
-				ast_log(LOG_ERROR, "Bad ACL entry in configuration line %d : %s\n", v->lineno, v->value);
+							sip_cfg.contact_ha, &ha_error);
+			if (ha_error) {
+				ast_log(LOG_ERROR, "Bad or unresolved host/IP entry in configuration for peer %s, cannot add to contact ACL\n", peer->name);
 			}
 		}
 	} else if (peer->dnsmgr && !peer->host_dynamic) {

Modified: branches/10/main/acl.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/acl.c?view=diff&rev=343852&r1=343851&r2=343852
==============================================================================
--- branches/10/main/acl.c (original)
+++ branches/10/main/acl.c Tue Nov  8 12:01:11 2011
@@ -408,6 +408,9 @@
 	}
 
 	if (!(ha = ast_calloc(1, sizeof(*ha)))) {
+		if (error) {
+			*error = 1;
+		}
 		return ret;
 	}
 




More information about the asterisk-commits mailing list