summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-12-13 07:36:12 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-12-13 07:36:12 -0600
commit9b94e440aec9a163918c0e4731ed74c47205949c (patch)
treea06c25dce3b89c00811cbea7b700327af3a73ed9 /channels
parent2b8a152c6943e75308aa2cd6e3e5245644dbebed (diff)
parentce2c89ce6847339d7a14169ba769f955118aa6b0 (diff)
Merge "chan_sip: Don't crash in Dial on invalid destination" into 13
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 643272858..9add42564 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -30466,6 +30466,17 @@ static struct ast_channel *sip_request_call(const char *type, struct ast_format_
ast_string_field_set(p, todnid, dnid);
}
+ /* 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;
+ if (callid) {
+ ast_callid_unref(callid);
+ }
+ return NULL;
+ }
+
/* Divvy up the items separated by slashes */
AST_NONSTANDARD_APP_ARGS(args, tmp, '/');