summaryrefslogtreecommitdiff
path: root/apps/app_page.c
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2009-01-25 13:35:48 +0000
committerSean Bright <sean@malleable.com>2009-01-25 13:35:48 +0000
commitec5aa59105b275ac39336fc1a1b9be7889bc5e09 (patch)
tree00f2ba8178bf5eb490abad5cc1f814b6e2b7b9b9 /apps/app_page.c
parent6101eccc9f2a875f3702adccc3f3819059d5bffa (diff)
Merged revisions 170979 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r170979 | seanbright | 2009-01-25 08:33:20 -0500 (Sun, 25 Jan 2009) | 9 lines 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 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@170980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_page.c')
-rw-r--r--apps/app_page.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/apps/app_page.c b/apps/app_page.c
index 2175da4b6..a393e81f9 100644
--- a/apps/app_page.c
+++ b/apps/app_page.c
@@ -170,12 +170,15 @@ static int page_exec(struct ast_channel *chan, void *data)
/* Count number of extensions in list by number of ampersands + 1 */
num_dials = 1;
tmp = args.devices;
- while (*tmp && *tmp++ == '&') {
- num_dials++;
+ while (*tmp) {
+ if (*tmp == '&') {
+ num_dials++;
+ }
+ tmp++;
}
- 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));
+ 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));
return -1;
}