summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMartin Pycko <martinp@digium.com>2003-11-21 21:53:54 +0000
committerMartin Pycko <martinp@digium.com>2003-11-21 21:53:54 +0000
commit967871d4b85a2d11107caa5167186a1a05dead4e (patch)
tree61cfe3759496a6736b5f4b74b1acda3cfb0b473d /apps
parentd4c9f37994760707440368c64262ac869d6bc039 (diff)
Fix the segfault with duration=atol(NULL)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps')
-rwxr-xr-xapps/app_voicemail.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 364d205e5..4c28d16a7 100755
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -1937,8 +1937,11 @@ forward_message(struct ast_channel *chan, char *context, char *dir, int curmsg,
/* set callerid and duration variables */
snprintf(callerid, sizeof(callerid), "FWD from: %s from %s", sender->fullname, ast_variable_retrieve(mif, NULL, "callerid"));
- duration = atol(ast_variable_retrieve(mif, NULL, "duration"));
-
+ s = ast_variable_retrieve(mif, NULL, "duration");
+ if (s)
+ duration = atol(s);
+ else
+ duration = 0;
if (strlen(receiver->email)) {
int attach_user_voicemail = attach_voicemail;
char *myserveremail = serveremail;
@@ -1946,7 +1949,7 @@ forward_message(struct ast_channel *chan, char *context, char *dir, int curmsg,
attach_user_voicemail = receiver->attach;
if (strlen(receiver->serveremail))
myserveremail = receiver->serveremail;
- sendmail(myserveremail, receiver, todircount, username, callerid, fn, tmp, atol(ast_variable_retrieve(mif, NULL, "duration")), attach_user_voicemail);
+ sendmail(myserveremail, receiver, todircount, username, callerid, fn, tmp, duration), attach_user_voicemail);
}
if (strlen(receiver->pager)) {