From 34f2e94230d1fcd3371ba26fb6c39f8fb328eee7 Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Tue, 26 Sep 2017 15:34:04 +0200 Subject: [PATCH] do not crash on null reason header --- coreapi/bellesip_sal/sal_op_call.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreapi/bellesip_sal/sal_op_call.c b/coreapi/bellesip_sal/sal_op_call.c index 1236331f3..695a71ac5 100644 --- a/coreapi/bellesip_sal/sal_op_call.c +++ b/coreapi/bellesip_sal/sal_op_call.c @@ -948,7 +948,7 @@ int sal_call_cancel_invite_with_info(SalOp* op, const SalErrorInfo *info) { ms_message("Cancelling INVITE request from [%s] to [%s] ",sal_op_get_from(op), sal_op_get_to(op)); cancel = belle_sip_client_transaction_create_cancel(op->pending_client_trans); if (cancel){ - if (info != NULL){ + if (info != NULL && info->reason != SalReasonNone){ belle_sip_header_reason_t* reason = sal_call_make_reason_header(info); belle_sip_message_add_header(BELLE_SIP_MESSAGE(cancel),BELLE_SIP_HEADER(reason)); } @@ -1127,7 +1127,7 @@ int sal_call_terminate_with_error(SalOp *op, const SalErrorInfo *info){ switch(dialog_state) { case BELLE_SIP_DIALOG_CONFIRMED: { belle_sip_request_t * req = belle_sip_dialog_create_request(op->dialog,"BYE"); - if (info != NULL){ + if (info != NULL && info->reason != SalReasonNone){ belle_sip_header_reason_t* reason = sal_call_make_reason_header(info); belle_sip_message_add_header(BELLE_SIP_MESSAGE(req),BELLE_SIP_HEADER(reason)); }