[asterisk-commits] file: branch 1.2 r70898 - /branches/1.2/apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 21 16:37:56 CDT 2007


Author: file
Date: Thu Jun 21 16:37:55 2007
New Revision: 70898

URL: http://svn.digium.com/view/asterisk?view=rev&rev=70898
Log:
Don't explode if the gain option is specified without a value. (issue #9274 reported by mfarver)

Modified:
    branches/1.2/apps/app_voicemail.c

Modified: branches/1.2/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/apps/app_voicemail.c?view=diff&rev=70898&r1=70897&r2=70898
==============================================================================
--- branches/1.2/apps/app_voicemail.c (original)
+++ branches/1.2/apps/app_voicemail.c Thu Jun 21 16:37:55 2007
@@ -5179,7 +5179,11 @@
 			if (ast_test_flag(&flags, OPT_RECORDGAIN)) {
 				int gain;
 
-				if (sscanf(opts[OPT_ARG_RECORDGAIN], "%d", &gain) != 1) {
+				if (ast_strlen_zero(opts[OPT_ARG_RECORDGAIN])) {
+					ast_log(LOG_WARNING, "No value provided for record gain option\n");
+					LOCAL_USER_REMOVE(u);
+					return -1;
+				} else if (sscanf(opts[OPT_ARG_RECORDGAIN], "%d", &gain) != 1) {
 					ast_log(LOG_WARNING, "Invalid value '%s' provided for record gain option\n", opts[OPT_ARG_RECORDGAIN]);
 					LOCAL_USER_REMOVE(u);
 					return -1;




More information about the asterisk-commits mailing list