[asterisk-commits] seanbright: trunk r304639 - in /trunk: ./ main/acl.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 28 14:20:01 CST 2011


Author: seanbright
Date: Fri Jan 28 14:19:57 2011
New Revision: 304639

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=304639
Log:
Merged revisions 304638 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r304638 | seanbright | 2011-01-28 15:19:08 -0500 (Fri, 28 Jan 2011) | 11 lines
  
  Restore some conditionals that we lost in r277814.
  
  There are some cases where ast_append_ha() is called with a NULL instead of a
  valid int pointer.  So if we get a NULL, don't try to dereference it.
  
  (closes issue #18162)
  Reported by: imcdona
  Patches:
        issue0018162.patch uploaded by pabelanger (license 224)
  Tested by: enegaard
........

Modified:
    trunk/   (props changed)
    trunk/main/acl.c

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

Modified: trunk/main/acl.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/acl.c?view=diff&rev=304639&r1=304638&r2=304639
==============================================================================
--- trunk/main/acl.c (original)
+++ trunk/main/acl.c Fri Jan 28 14:19:57 2011
@@ -421,7 +421,9 @@
 	if (!ast_sockaddr_parse(&ha->addr, address, PARSE_PORT_FORBID)) {
 		ast_log(LOG_WARNING, "Invalid IP address: %s\n", address);
 		ast_free_ha(ha);
-		*error = 1;
+		if (error) {
+			*error = 1;
+		}
 		return ret;
 	}
 
@@ -443,7 +445,9 @@
 		if (!ast_sockaddr_parse(&ha->netmask, mask, PARSE_PORT_FORBID)) {
 			ast_log(LOG_WARNING, "Invalid netmask: %s\n", mask);
 			ast_free_ha(ha);
-			*error = 1;
+			if (error) {
+				*error = 1;
+			}
 			return ret;
 		}
 		/* If someone specifies an IPv4-mapped IPv6 netmask,
@@ -457,13 +461,17 @@
 		if (addr_is_v4 ^ mask_is_v4) {
 			ast_log(LOG_WARNING, "Address and mask are not using same address scheme.\n");
 			ast_free_ha(ha);
-			*error = 1;
+			if (error) {
+				*error = 1;
+			}
 			return ret;
 		}
 	} else if (parse_cidr_mask(&ha->netmask, addr_is_v4, mask)) {
 		ast_log(LOG_WARNING, "Invalid CIDR netmask: %s\n", mask);
 		ast_free_ha(ha);
-		*error = 1;
+		if (error) {
+			*error = 1;
+		}
 		return ret;
 	}
 
@@ -475,7 +483,9 @@
 		char *failaddr = ast_strdupa(ast_sockaddr_stringify(&ha->addr));
 		ast_log(LOG_WARNING, "Unable to apply netmask %s to address %s\n", failmask, failaddr);
 		ast_free_ha(ha);
-		*error = 1;
+		if (error) {
+			*error = 1;
+		}
 		return ret;
 	}
 




More information about the asterisk-commits mailing list