[asterisk-commits] seanbright: branch 1.4 r170979 - /branches/1.4/apps/app_page.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jan 25 07:33:21 CST 2009


Author: seanbright
Date: Sun Jan 25 07:33:20 2009
New Revision: 170979

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=170979
Log:
Resolve a logic error that was causing Page() to crash when more than one
channel was specified.

(closes issue #14308)
Reported by: bluefox
Patches:
      20090124__bug14308.diff.txt uploaded by seanbright (license 71)
Tested by: kc0bvu

Modified:
    branches/1.4/apps/app_page.c

Modified: branches/1.4/apps/app_page.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/apps/app_page.c?view=diff&rev=170979&r1=170978&r2=170979
==============================================================================
--- branches/1.4/apps/app_page.c (original)
+++ branches/1.4/apps/app_page.c Sun Jan 25 07:33:20 2009
@@ -120,12 +120,15 @@
 	/* Count number of extensions in list by number of ampersands + 1 */
 	num_dials = 1;
 	tmp2 = tmp;
-	while (*tmp2 && *tmp2++ == '&') {
-		num_dials++;
-	}
-
-	if (!(dial_list = ast_calloc(num_dials, sizeof(void *)))) {
-		ast_log(LOG_ERROR, "Can't allocate %ld bytes for dial list\n", (long)(sizeof(void *) * num_dials));
+	while (*tmp2) {
+		if (*tmp2 == '&') {
+			num_dials++;
+		}
+		tmp2++;
+	}
+
+	if (!(dial_list = ast_calloc(num_dials, sizeof(struct ast_dial *)))) {
+		ast_log(LOG_ERROR, "Can't allocate %ld bytes for dial list\n", (long)(sizeof(struct ast_dial *) * num_dials));
 		ast_module_user_remove(u);
 		return -1;
 	}




More information about the asterisk-commits mailing list