Skip to content
Snippets Groups Projects
Commit 967871d4 authored by Martin Pycko's avatar Martin Pycko
Browse files

Fix the segfault with duration=atol(NULL)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent d4c9f379
No related branches found
No related tags found
No related merge requests found
......@@ -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)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment