diff options
author | Joshua Colp <jcolp@digium.com> | 2017-12-13 07:26:38 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-12-13 07:26:38 -0600 |
commit | 0c3b972ef28a70820a2133ceb4b0fdd8ee9bf6e3 (patch) | |
tree | a99696f002df74af29b79e074d0742de2d33ac9c | |
parent | f23796ef295859baa28675528e04f095724d4a64 (diff) | |
parent | d22bccef95193b8c5898e25212b1c0b97d3b95b9 (diff) |
Merge "chan_sip: Don't crash in Dial on invalid destination" into 15
-rw-r--r-- | channels/chan_sip.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index c04182732..4bae39da0 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -30555,6 +30555,14 @@ static struct ast_channel *sip_request_call(const char *type, struct ast_format_ } } + /* If stripping the DNID left us with nothing, bail out */ + if (ast_strlen_zero(tmp)) { + dialog_unlink_all(p); + dialog_unref(p, "unref dialog p from bad destination"); + *cause = AST_CAUSE_DESTINATION_OUT_OF_ORDER; + return NULL; + } + /* Divvy up the items separated by slashes */ AST_NONSTANDARD_APP_ARGS(args, tmp, '/'); |