diff options
author | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-16 18:29:12 +0000 |
---|---|---|
committer | file <file@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-11-16 18:29:12 +0000 |
commit | fbcf145954305b29496c312da041500ecde5a9a6 (patch) | |
tree | 7e51ce8e62893f31ea4d2ba88c5b51dbea47314d /channels | |
parent | 99857cb020ea90b2a81e6ca7a34c1ee56ffd8d6e (diff) |
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/branches/1.4@47751 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-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) { |