aboutsummaryrefslogtreecommitdiffstats
path: root/apps/app_talkdetect.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-05 17:40:42 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-03-05 17:40:42 +0000
commit8952c2ca0f3d0b99e2031a6968bda16ac8a5154e (patch)
tree15483153d601d7378b25184edadcc98c12b6c284 /apps/app_talkdetect.c
parent2e5953ed87758d87ea02095f0a9476029c099f8d (diff)
Should check these values for non-NULL before scanning.
(Closes issue #12147) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@106139 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'apps/app_talkdetect.c')
-rw-r--r--apps/app_talkdetect.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/app_talkdetect.c b/apps/app_talkdetect.c
index 0aa5e818b..fb862440d 100644
--- a/apps/app_talkdetect.c
+++ b/apps/app_talkdetect.c
@@ -83,11 +83,11 @@ static int background_detect_exec(struct ast_channel *chan, void *data)
tmp = ast_strdupa(data);
AST_STANDARD_APP_ARGS(args, tmp);
- if ((sscanf(args.silence, "%d", &x) == 1) && (x > 0))
+ if (!ast_strlen_zero(args.silence) && (sscanf(args.silence, "%d", &x) == 1) && (x > 0))
sil = x;
- if ((sscanf(args.min, "%d", &x) == 1) && (x > 0))
+ if (!ast_strlen_zero(args.min) && (sscanf(args.min, "%d", &x) == 1) && (x > 0))
min = x;
- if ((sscanf(args.max, "%d", &x) == 1) && (x > 0))
+ if (!ast_strlen_zero(args.max) && (sscanf(args.max, "%d", &x) == 1) && (x > 0))
max = x;
ast_debug(1, "Preparing detect of '%s', sil=%d, min=%d, max=%d\n", args.filename, sil, min, max);