Skip to content

Commit fbde018

Browse files
InterLinked1Friendly Automation
authored andcommitted
ami: Improve substring parsing for disabled events.
ASTERISK_29853 added the ability to selectively disable AMI events on a global basis, but the logic for this uses strstr which means that events with names which are the prefix of another event, if disabled, could disable those events as well. Instead, we account for this possibility to prevent this undesired behavior from occuring. ASTERISK_29853 Change-Id: Icccd1872602889806740971e4adf932f92466959
1 parent b40c4d5 commit fbde018

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main/manager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7234,7 +7234,7 @@ int __ast_manager_event_multichan(int category, const char *event, int chancount
72347234
int res;
72357235

72367236
if (!ast_strlen_zero(manager_disabledevents)) {
7237-
if (strstr(manager_disabledevents, event)) {
7237+
if (ast_in_delimited_string(event, manager_disabledevents, ',')) {
72387238
ast_debug(3, "AMI Event '%s' is globally disabled, skipping\n", event);
72397239
/* Event is globally disabled */
72407240
ao2_cleanup(sessions);

0 commit comments

Comments
 (0)