summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2017-12-13 07:14:13 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-12-13 07:14:13 -0600
commit58514c74427eb4da33ac90fa01aa55a885cdba3b (patch)
tree102b86054d2b11b4de6f3270e2ac3bef535f14c7 /channels
parente7dccbe708bccdb08c15c3ff24ad7cfb9d1cc914 (diff)
parent5039b5741c46a155cc988def618276e88099b73d (diff)
Merge "chan_sip: Don't crash in Dial on invalid destination"
Diffstat (limited to 'channels')
-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 1775c009c..f5cf8ca30 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -30716,6 +30716,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, '/');