[asterisk-commits] russell: branch 1.8 r283209 - /branches/1.8/main/cel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Aug 23 08:07:00 CDT 2010


Author: russell
Date: Mon Aug 23 08:06:57 2010
New Revision: 283209

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=283209
Log:
Don't blow up on an invalid AMA flag.

Modified:
    branches/1.8/main/cel.c

Modified: branches/1.8/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/cel.c?view=diff&rev=283209&r1=283208&r2=283209
==============================================================================
--- branches/1.8/main/cel.c (original)
+++ branches/1.8/main/cel.c Mon Aug 23 08:06:57 2010
@@ -349,6 +349,11 @@
 
 const char *ast_cel_get_ama_flag_name(enum ast_cel_ama_flag flag)
 {
+	if (flag < 0 || flag >= ARRAY_LEN(cel_ama_flags)) {
+		ast_log(LOG_WARNING, "Invalid AMA flag: %d\n", flag);
+		return "Unknown";
+	}
+
 	return S_OR(cel_ama_flags[flag], "Unknown");
 }
 




More information about the asterisk-commits mailing list