diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-16 18:32:27 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-16 18:32:27 +0000 |
commit | 630a8583c3d0d11728f3d03b4d206bb29f1bb15c (patch) | |
tree | 46a1bb6c1b33488e615241d65ea1951b75683fa2 | |
parent | a42547e25e001c864e0c8076a39488b5f14fb219 (diff) |
Merged revisions 47751 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r47751 | file | 2006-11-16 13:29:12 -0500 (Thu, 16 Nov 2006) | 10 lines
Merged revisions 47750 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r47750 | file | 2006-11-16 13:26:50 -0500 (Thu, 16 Nov 2006) | 2 lines
Because of the way chan_local is written we should be extra careful and make sure our callback functions have a tech_pvt. (issue #8275 reported by mflorell)
........
................
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47752 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_local.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c index e1028aa1e..e4c7612cf 100644 --- a/channels/chan_local.c +++ b/channels/chan_local.c @@ -203,6 +203,9 @@ static int local_answer(struct ast_channel *ast) int isoutbound; int res = -1; + if (!p) + return -1; + ast_mutex_lock(&p->lock); isoutbound = IS_OUTBOUND(ast, p); if (isoutbound) { @@ -276,6 +279,9 @@ static int local_write(struct ast_channel *ast, struct ast_frame *f) int res = -1; int isoutbound; + if (!p) + return -1; + /* Just queue for delivery to the other side */ ast_mutex_lock(&p->lock); isoutbound = IS_OUTBOUND(ast, p); @@ -321,6 +327,9 @@ static int local_indicate(struct ast_channel *ast, int condition, const void *da struct ast_frame f = { AST_FRAME_CONTROL, }; int isoutbound; + if (!p) + return -1; + /* If this is an MOH hold or unhold, do it on the Local channel versus real channel */ if (condition == AST_CONTROL_HOLD) { ast_moh_start(ast, data, NULL); @@ -347,6 +356,9 @@ static int local_digit_begin(struct ast_channel *ast, char digit) struct ast_frame f = { AST_FRAME_DTMF_BEGIN, }; int isoutbound; + if (!p) + return -1; + ast_mutex_lock(&p->lock); isoutbound = IS_OUTBOUND(ast, p); f.subclass = digit; @@ -363,6 +375,9 @@ static int local_digit_end(struct ast_channel *ast, char digit) struct ast_frame f = { AST_FRAME_DTMF_END, }; int isoutbound; + if (!p) + return -1; + ast_mutex_lock(&p->lock); isoutbound = IS_OUTBOUND(ast, p); f.subclass = digit; @@ -379,6 +394,9 @@ static int local_sendtext(struct ast_channel *ast, const char *text) struct ast_frame f = { AST_FRAME_TEXT, }; int isoutbound; + if (!p) + return -1; + ast_mutex_lock(&p->lock); isoutbound = IS_OUTBOUND(ast, p); f.data = (char *) text; @@ -395,6 +413,9 @@ static int local_sendhtml(struct ast_channel *ast, int subclass, const char *dat struct ast_frame f = { AST_FRAME_HTML, }; int isoutbound; + if (!p) + return -1; + ast_mutex_lock(&p->lock); isoutbound = IS_OUTBOUND(ast, p); f.subclass = subclass; @@ -413,6 +434,9 @@ static int local_call(struct ast_channel *ast, char *dest, int timeout) int res; struct ast_var_t *varptr = NULL, *new; size_t len, namelen; + + if (!p) + return -1; ast_mutex_lock(&p->lock); @@ -454,6 +478,9 @@ static int local_hangup(struct ast_channel *ast) struct ast_channel *ochan = NULL; int glaredetect = 0; + if (!p) + return -1; + ast_mutex_lock(&p->lock); isoutbound = IS_OUTBOUND(ast, p); if (isoutbound) { |