summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-12-13 07:26:38 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-12-13 07:26:38 -0600
commit0c3b972ef28a70820a2133ceb4b0fdd8ee9bf6e3 (patch)
treea99696f002df74af29b79e074d0742de2d33ac9c
parentf23796ef295859baa28675528e04f095724d4a64 (diff)
parentd22bccef95193b8c5898e25212b1c0b97d3b95b9 (diff)
Merge "chan_sip: Don't crash in Dial on invalid destination" into 15
-rw-r--r--channels/chan_sip.c8
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, '/');