mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@424752 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3146,7 +3146,7 @@ int ast_data_add_codecs(struct ast_data *root, const char *node_name, struct ast
|
|||||||
}
|
}
|
||||||
|
|
||||||
count = ast_format_cap_count(cap);
|
count = ast_format_cap_count(cap);
|
||||||
for (i = 1; i <= count; ++i) {
|
for (i = 0; i < count; ++i) {
|
||||||
struct ast_format *fmt;
|
struct ast_format *fmt;
|
||||||
|
|
||||||
fmt = ast_format_cap_get_format(cap, i);
|
fmt = ast_format_cap_get_format(cap, i);
|
||||||
|
Reference in New Issue
Block a user