[asterisk-commits] tilghman: branch 1.6.1 r246024 - in /branches/1.6.1: ./ funcs/func_strings.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Feb 10 09:38:30 CST 2010


Author: tilghman
Date: Wed Feb 10 09:38:27 2010
New Revision: 246024

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=246024
Log:
Merged revisions 246022 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r246022 | tilghman | 2010-02-10 09:36:57 -0600 (Wed, 10 Feb 2010) | 2 lines
  
  Enable warnings on atypical conditions for the FILTER function (suggested by mmichelson on the -dev list).
........

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/funcs/func_strings.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/funcs/func_strings.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.1/funcs/func_strings.c?view=diff&rev=246024&r1=246023&r2=246024
==============================================================================
--- branches/1.6.1/funcs/func_strings.c (original)
+++ branches/1.6.1/funcs/func_strings.c Wed Feb 10 09:38:27 2010
@@ -99,6 +99,10 @@
 		return -1;
 	}
 
+	if (args.allowed[0] == '"' && !ast_opt_dont_warn) {
+		ast_log(LOG_WARNING, "FILTER allowed characters includes the quote (\") character.  This may not be what you want.\n");
+	}
+
 	/* Expand ranges */
 	for (; *(args.allowed) && allowedlen < sizeof(allowed); ) {
 		char c1 = 0, c2 = 0;
@@ -112,6 +116,10 @@
 			if (ast_get_encoded_char(args.allowed + 1, &c2, &consumed))
 				c2 = -1;
 			args.allowed += consumed + 1;
+
+			if ((c2 < c1 || c2 == -1) && !ast_opt_dont_warn) {
+				ast_log(LOG_WARNING, "Range wrapping in FILTER(%s,%s).  This may not be what you want.\n", parse, args.string);
+			}
 
 			/*!\note
 			 * Looks a little strange, until you realize that we can overflow




More information about the asterisk-commits mailing list