[asterisk-commits] branch 1.2 r16534 - /branches/1.2/res/res_musiconhold.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Thu Mar 30 10:55:30 MST 2006


Author: file
Date: Thu Mar 30 11:55:28 2006
New Revision: 16534

URL: http://svn.digium.com/view/asterisk?rev=16534&view=rev
Log:
Do not exceed the array size for maximum allowed moh files. (issue #6842)

Modified:
    branches/1.2/res/res_musiconhold.c

Modified: branches/1.2/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/res/res_musiconhold.c?rev=16534&r1=16533&r2=16534&view=diff
==============================================================================
--- branches/1.2/res/res_musiconhold.c (original)
+++ branches/1.2/res/res_musiconhold.c Thu Mar 30 11:55:28 2006
@@ -778,6 +778,11 @@
 
 		if (i == class->total_files)
 			strcpy(class->filearray[class->total_files++], filepath);
+
+		/* If the new total files is equal to the maximum allowed, stop adding new ones */
+		if (class->total_files == MAX_MOHFILES)
+			break;
+
 	}
 
 	closedir(files_DIR);



More information about the asterisk-commits mailing list