diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-25 14:46:41 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-25 14:46:41 +0000 |
commit | 0ba69f04be21954635d17becd6834c821bf2dfa3 (patch) | |
tree | bc9128b0db1fc5c0993f4c4ea0042f382eb1da9f /main/channel.c | |
parent | ee4a195ba6448c2790dfc863a0dc633066d98481 (diff) |
Merged revisions 56684 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r56684 | tilghman | 2007-02-25 08:38:03 -0600 (Sun, 25 Feb 2007) | 3 lines
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: http://svn.digium.com/svn/asterisk/branches/1.4@56685 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/channel.c')
-rw-r--r-- | main/channel.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main/channel.c b/main/channel.c index da8f22a6a..eecf0e64c 100644 --- a/main/channel.c +++ b/main/channel.c @@ -997,7 +997,11 @@ static struct ast_channel *channel_find_locked(const struct ast_channel *prev, if (c != prev) /* not this one */ continue; /* found, prepare to return c->next */ - c = AST_LIST_NEXT(c, chan_list); + if ((c = AST_LIST_NEXT(c, chan_list)) == 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 ((!namelen && strcasecmp(c->name, name)) || |