Skip to content
Snippets Groups Projects
Commit 1546f966 authored by Jeff Peeler's avatar Jeff Peeler
Browse files

Fixes segfault in parking, patch submitted by bmd.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 0b06cc02
Branches
Tags
No related merge requests found
...@@ -2601,7 +2601,7 @@ static int park_call_exec(struct ast_channel *chan, void *data) ...@@ -2601,7 +2601,7 @@ static int park_call_exec(struct ast_channel *chan, void *data)
lot context eventually */ lot context eventually */
int res = 0; int res = 0;
char *parse; char *parse = NULL;
AST_DECLARE_APP_ARGS(app_args, AST_DECLARE_APP_ARGS(app_args,
AST_APP_ARG(timeout); AST_APP_ARG(timeout);
AST_APP_ARG(return_con); AST_APP_ARG(return_con);
...@@ -2637,7 +2637,7 @@ static int park_call_exec(struct ast_channel *chan, void *data) ...@@ -2637,7 +2637,7 @@ static int park_call_exec(struct ast_channel *chan, void *data)
}; };
struct ast_flags flags = { 0 }; struct ast_flags flags = { 0 };
if (!ast_strlen_zero(app_args.timeout)) { if (parse && !ast_strlen_zero(app_args.timeout)) {
if (sscanf(app_args.timeout, "%d", &args.timeout) != 1) { if (sscanf(app_args.timeout, "%d", &args.timeout) != 1) {
ast_log(LOG_WARNING, "Invalid timeout '%s' provided\n", app_args.timeout); ast_log(LOG_WARNING, "Invalid timeout '%s' provided\n", app_args.timeout);
args.timeout = 0; args.timeout = 0;
...@@ -2646,7 +2646,7 @@ static int park_call_exec(struct ast_channel *chan, void *data) ...@@ -2646,7 +2646,7 @@ static int park_call_exec(struct ast_channel *chan, void *data)
args.return_con = app_args.return_con; args.return_con = app_args.return_con;
args.return_ext = app_args.return_ext; args.return_ext = app_args.return_ext;
if (!ast_strlen_zero(app_args.return_pri)) { if (parse && !ast_strlen_zero(app_args.return_pri)) {
if (sscanf(app_args.return_pri, "%d", &args.return_pri) != 1) { if (sscanf(app_args.return_pri, "%d", &args.return_pri) != 1) {
ast_log(LOG_WARNING, "Invalid priority '%s' specified\n", app_args.return_pri); ast_log(LOG_WARNING, "Invalid priority '%s' specified\n", app_args.return_pri);
args.return_pri = 0; args.return_pri = 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment