mirror of
https://github.com/asterisk/asterisk.git
synced 2026-07-07 23:29:20 -07:00
Don't crash when invalid arguments are provided to the CHANNEL() function
for a SIP channel. (issue #9619, reported by jtodd, original patch by Corydon76, committed patch slightly modified by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
+8
-2
@@ -14911,12 +14911,15 @@ static int acf_channel_read(struct ast_channel *chan, const char *funcname, char
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (strcasecmp(args.param, "rtpqos"))
|
||||
return 0;
|
||||
if (ast_strlen_zero(args.param) || strcasecmp(args.param, "rtpqos"))
|
||||
return -1;
|
||||
|
||||
memset(buf, 0, buflen);
|
||||
memset(&qos, 0, sizeof(qos));
|
||||
|
||||
if (ast_strlen_zero(args.type))
|
||||
return -1;
|
||||
|
||||
if (strcasecmp(args.type, "AUDIO") == 0) {
|
||||
all = ast_rtp_get_quality(p->rtp, &qos);
|
||||
} else if (strcasecmp(args.type, "VIDEO") == 0) {
|
||||
@@ -14925,6 +14928,9 @@ static int acf_channel_read(struct ast_channel *chan, const char *funcname, char
|
||||
all = ast_rtp_get_quality(p->trtp, &qos);
|
||||
}
|
||||
|
||||
if (ast_strlen_zero(args.field))
|
||||
return -1;
|
||||
|
||||
if (strcasecmp(args.field, "local_ssrc") == 0)
|
||||
snprintf(buf, buflen, "%u", qos.local_ssrc);
|
||||
else if (strcasecmp(args.field, "local_lostpackets") == 0)
|
||||
|
||||
Reference in New Issue
Block a user