summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzuul <zuul@gerrit.asterisk.org>2017-02-28 13:32:19 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2017-02-28 13:32:19 -0600
commitbf3cb76452d968a73414748c62c96645c0115abb (patch)
treeee2c40ac4a05ac1ba813b74e0b83633e8150e6b3
parent5b34b751a0bee53d8563a1a11a25ccdaa951c3f7 (diff)
parent0595c31da749b18a60d957b8685b93c96045cd68 (diff)
Merge "res_pjsip: Fix crash when contact has no status" into 13
-rw-r--r--res/res_pjsip/pjsip_options.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index d4159f508..d4ea911c9 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -1260,8 +1260,8 @@ int ast_sip_format_contact_ami(void *obj, void *arg, int flags)
if (!ast_strlen_zero(contact->call_id)) {
ast_str_append(&buf, 0, "CallID: %s\r\n", contact->call_id);
}
- ast_str_append(&buf, 0, "Status: %s\r\n", ast_sip_get_contact_status_label(status->status));
- if (status->status == UNKNOWN) {
+ ast_str_append(&buf, 0, "Status: %s\r\n", ast_sip_get_contact_status_label(status ? status->status : UNKNOWN));
+ if (!status || status->status == UNKNOWN) {
ast_str_append(&buf, 0, "RoundtripUsec: N/A\r\n");
} else {
ast_str_append(&buf, 0, "RoundtripUsec: %" PRId64 "\r\n", status->rtt);