mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-08 19:08:14 +00:00
Issue 9130 - If prev is the last item on the channel list, then evaluating
additional conditions (e.g. name prefix) will cause a NULL dereference. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@56684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -747,7 +747,11 @@ static struct ast_channel *channel_find_locked(const struct ast_channel *prev,
|
|||||||
if (c != prev) /* not this one */
|
if (c != prev) /* not this one */
|
||||||
continue;
|
continue;
|
||||||
/* found, prepare to return c->next */
|
/* found, prepare to return c->next */
|
||||||
c = c->next;
|
if ((c = c->next) == NULL) break;
|
||||||
|
/* If prev was the last item on the channel list, then we just
|
||||||
|
* want to return NULL, instead of trying to deref NULL in the
|
||||||
|
* next section.
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
if (name) { /* want match by name */
|
if (name) { /* want match by name */
|
||||||
if ((!namelen && strcasecmp(c->name, name)) ||
|
if ((!namelen && strcasecmp(c->name, name)) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user