diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-30 15:37:23 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-04-30 15:37:23 +0000 |
commit | e82a35607713f6185b999914b2a5707e688badf9 (patch) | |
tree | 7f16d30fc195da93b5ee72909e70245843ec1278 | |
parent | ec3ba251f0761f8a3a06ccc34ef229079975421a (diff) |
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: http://svn.digium.com/svn/asterisk/trunk@62416 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | channels/chan_sip.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 4c6243aaa..cdff58927 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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) |