[asterisk-commits] file: branch 13 r424752 - /branches/13/main/data.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Oct 7 13:33:51 CDT 2014


Author: file
Date: Tue Oct  7 13:33:45 2014
New Revision: 424752

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=424752
Log:
data: Properly access formats in capabilities structure when adding codecs.

Formats within a capabilities structure are addressed starting at 0, not 1.
Assuming 1 causes it to exceed an array.

ASTERISK-24389 #close
Reported by: Kevin Harwell

Modified:
    branches/13/main/data.c

Modified: branches/13/main/data.c
URL: http://svnview.digium.com/svn/asterisk/branches/13/main/data.c?view=diff&rev=424752&r1=424751&r2=424752
==============================================================================
--- branches/13/main/data.c (original)
+++ branches/13/main/data.c Tue Oct  7 13:33:45 2014
@@ -3146,7 +3146,7 @@
 	}
 
 	count = ast_format_cap_count(cap);
-	for (i = 1; i <= count; ++i) {
+	for (i = 0; i < count; ++i) {
 		struct ast_format *fmt;
 
 		fmt = ast_format_cap_get_format(cap, i);




More information about the asterisk-commits mailing list