aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_local.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-16 18:26:50 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-16 18:26:50 +0000
commit0276608f7857c918d34bc8f5af542fe27dfd09d7 (patch)
tree349b3bcceb907486b9ed63a27f9015bfea2faf33 /channels/chan_local.c
parentaa106ce296e1d000ee0c2c2c44aa1dbdff02d44c (diff)
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.2@47750 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_local.c')
-rw-r--r--channels/chan_local.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/channels/chan_local.c b/channels/chan_local.c
index 29c856573..b3bf3b24c 100644
--- a/channels/chan_local.c
+++ b/channels/chan_local.c
@@ -168,6 +168,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) {
@@ -245,6 +248,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);
@@ -289,6 +295,9 @@ static int local_indicate(struct ast_channel *ast, int condition)
struct ast_frame f = { AST_FRAME_CONTROL, };
int isoutbound;
+ if (!p)
+ return -1;
+
/* Queue up a frame representing the indication as a control frame */
ast_mutex_lock(&p->lock);
isoutbound = IS_OUTBOUND(ast, p);
@@ -305,6 +314,9 @@ static int local_digit(struct ast_channel *ast, char digit)
struct ast_frame f = { AST_FRAME_DTMF, };
int isoutbound;
+ if (!p)
+ return -1;
+
ast_mutex_lock(&p->lock);
isoutbound = IS_OUTBOUND(ast, p);
f.subclass = digit;
@@ -320,6 +332,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;
@@ -338,6 +353,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);
@@ -414,6 +432,9 @@ static int local_hangup(struct ast_channel *ast)
struct ast_channel *ochan = NULL;
int glaredetect;
+ if (!p)
+ return -1;
+
ast_mutex_lock(&p->lock);
isoutbound = IS_OUTBOUND(ast, p);
if (isoutbound) {