[asterisk-commits] tilghman: trunk r106139 - /trunk/apps/app_talkdetect.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 5 11:40:42 CST 2008


Author: tilghman
Date: Wed Mar  5 11:40:42 2008
New Revision: 106139

URL: http://svn.digium.com/view/asterisk?view=rev&rev=106139
Log:
Should check these values for non-NULL before scanning.
(Closes issue #12147)

Modified:
    trunk/apps/app_talkdetect.c

Modified: trunk/apps/app_talkdetect.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_talkdetect.c?view=diff&rev=106139&r1=106138&r2=106139
==============================================================================
--- trunk/apps/app_talkdetect.c (original)
+++ trunk/apps/app_talkdetect.c Wed Mar  5 11:40:42 2008
@@ -83,11 +83,11 @@
 	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);




More information about the asterisk-commits mailing list