[asterisk-commits] russell: branch 1.4 r85556 - /branches/1.4/pbx/pbx_dundi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Oct 15 10:40:45 CDT 2007


Author: russell
Date: Mon Oct 15 10:40:45 2007
New Revision: 85556

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85556
Log:
Ensure the buffer passed to ast_canmatch_extension() is properly initialized so
that it is null terminated.

(issue #10977)
Reported by: dimas
Patches: 
      pbxdundi.patch uploaded by dimas (license 88)
	    - small mods by me

Modified:
    branches/1.4/pbx/pbx_dundi.c

Modified: branches/1.4/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/pbx/pbx_dundi.c?view=diff&rev=85556&r1=85555&r2=85556
==============================================================================
--- branches/1.4/pbx/pbx_dundi.c (original)
+++ branches/1.4/pbx/pbx_dundi.c Mon Oct 15 10:40:45 2007
@@ -578,8 +578,8 @@
 		} else {
 			/* No answers...  Find the fewest number of digits from the
 			   number for which we have no answer. */
-			char tmp[AST_MAX_EXTENSION];
-			for (x=0;x<AST_MAX_EXTENSION;x++) {
+			char tmp[AST_MAX_EXTENSION + 1] = "";
+			for (x = 0; x < (sizeof(tmp) - 1); x++) {
 				tmp[x] = called_number[x];
 				if (!tmp[x])
 					break;




More information about the asterisk-commits mailing list