diff options
author | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-06-17 18:23:01 +0000 |
---|---|---|
committer | Tilghman Lesher <tilghman@meg.abyt.es> | 2008-06-17 18:23:01 +0000 |
commit | 6d5b1d76abab528b2ec0ed6d27de2470ce98da5a (patch) | |
tree | 4d9fcd4bcb1cb6a5f71e4a7768695bb0c4bae483 /main | |
parent | 8c6184f0dad482ded0ad1574449c6ac234c759f6 (diff) |
If we don't match registrar when destroying a context, it can cause a crash.
(closes issue #12835)
Reported by: ys
Patches:
pbx.c.diff uploaded by ys (license 281)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r-- | main/pbx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c index 9654bd88f..a0ba3a901 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -7153,13 +7153,13 @@ void __ast_context_destroy(struct ast_context *list, struct ast_hashtab *context struct ast_context *tmp, *tmpl=NULL; struct ast_exten *exten_item, *prio_item; - for (tmp = list; tmp; ) { struct ast_context *next = NULL; /* next starting point */ for (; tmp; tmpl = tmp, tmp = tmp->next) { ast_debug(1, "check ctx %s %s\n", tmp->name, tmp->registrar); - if ( registrar || (con && strcasecmp(tmp->name, con->name)) ) + if ( (registrar && !strcasecmp(tmp->registrar, registrar)) || (con && !strcasecmp(tmp->name, con->name)) ) { break; /* found it */ + } } if (!tmp) /* not found, we are done */ break; |