[asterisk-bugs] [JIRA] (ASTERISK-28570) Potential infinite loop in function find_matching_priority

Asterisk Team (JIRA) noreply at issues.asterisk.org
Mon Oct 7 08:55:47 CDT 2019


    [ https://issues.asterisk.org/jira/browse/ASTERISK-28570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=248265#comment-248265 ] 

Asterisk Team commented on ASTERISK-28570:
------------------------------------------

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

> Potential infinite loop in function find_matching_priority
> ----------------------------------------------------------
>
>                 Key: ASTERISK-28570
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28570
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_while
>    Affects Versions: 16.6.0
>         Environment: No
>            Reporter: Yoooooo Ha
>
> Summary: Potential infinite loop in function find_matching_priority.
> ####################################
> static struct ast_exten *find_matching_priority(struct ast_context *c, 
> const char *exten, int priority, const char *callerid)
> {
>          struct ast_exten *e;
>          struct ast_context *c2;
>          int idx;
>          for (e=ast_walk_context_extensions(c, NULL); e; 
> e=ast_walk_context_extensions(c, e)) {
>                  if (ast_extension_match(ast_get_extension_name(e), 
> exten)) {
>                          int needmatch = ast_get_extension_matchcid(e);
>                          if ((needmatch && 
> ast_extension_match(ast_get_extension_cidmatch(e), callerid)) ||
>                                  (!needmatch)) {
>                                  /* This is the matching extension we 
> want */
>                                  struct ast_exten *p;
>                                  for (p=ast_walk_extension_priorities(e, 
> NULL); p; p=ast_walk_extension_priorities(e, p)) {
>                                          if (priority != 
> ast_get_extension_priority(p))
>                                                  continue;
>                                          return p;
>                                  }
>                          }
>                  }
>          }
>          /* No match; run through includes */
>          for (idx = 0; idx < ast_context_includes_count(c); idx++) {
>                  const struct ast_include *i = 
> ast_context_includes_get(c, idx);
>                  for (c2=ast_walk_contexts(NULL); c2; 
> c2=ast_walk_contexts(c2)) {
>                          if (!strcmp(ast_get_context_name(c2), 
> ast_get_include_name(i))) {
>                                  e = find_matching_priority(c2, exten, 
> priority, callerid);
>                                  if (e)
>                                          return e;
>                          }
>                  }
>          }
>          return NULL;
> }
> ####################################
> Function find_matching_priority is a recursive function, and it is 
> called by function find_matching_endwhile.
> There is possibility that an infinite loop occurs.
> The vulnerability is same as the one fixed in 
> https://gerrit.asterisk.org/c/asterisk/+/8931 
> (https://issues.asterisk.org/jira/browse/ASTERISK-26570)



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list