diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-25 14:38:03 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-02-25 14:38:03 +0000 |
commit | b40f9ac39fb2e5c5519a3d348c6405d312a37a34 (patch) | |
tree | 70f36f4f08d9a9ba6f68f096c54336475f4caa97 | |
parent | 8ff7033a0cafd85a44780c77fb3a85986bdb7176 (diff) |
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.2@56684 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channel.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -747,7 +747,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 = 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 ((!namelen && strcasecmp(c->name, name)) || |