mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 00:30:20 +00:00
ensure SIP_HEADER does not segfault when called on hung-up channels (bug #4756, different fix than posted patch)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -8158,6 +8158,13 @@ static char *func_header_read(struct ast_channel *chan, char *cmd, char *data, c
|
||||
}
|
||||
|
||||
p = chan->tech_pvt;
|
||||
|
||||
/* If there is no private structure, this channel is no longer alive */
|
||||
if (!p) {
|
||||
ast_mutex_unlock(&chan->lock);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
content = get_header(&p->initreq, data);
|
||||
|
||||
if (ast_strlen_zero(content)) {
|
||||
|
||||
Reference in New Issue
Block a user