aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-25 13:38:38 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-25 13:38:38 +0000
commit42d5290dcc81a897541a33d2feabb568640b0cb2 (patch)
tree55f015279e3c4e6d68975812d086d7923e74948c /apps
parent126219ef5b9df241b217f8d21fa5ca5a6149dfdd (diff)
Merged revisions 170980 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r170980 | seanbright | 2009-01-25 08:35:48 -0500 (Sun, 25 Jan 2009) | 16 lines 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: http://svn.digium.com/svn/asterisk/branches/1.6.0@170981 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps')
-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 2a8446faf..3e4f2c94a 100644
--- a/apps/app_page.c
+++ b/apps/app_page.c
@@ -111,12 +111,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;
tmp2 = tmp;
- while (*tmp2 && *tmp2++ == '&') {
- num_dials++;
+ while (*tmp2) {
+ if (*tmp2 == '&') {
+ num_dials++;
+ }
+ tmp2++;
}
- 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;
}