From eae1bde185d9786d54d9bc767ea518288078f6d0 Mon Sep 17 00:00:00 2001 From: fanpengy Date: Thu, 25 Aug 2022 12:19:18 -0400 Subject: [PATCH] Fix release INVITE server request lead to core dump at worng order 200 OK occur. --- libsofia-sip-ua/nua/nua_server.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libsofia-sip-ua/nua/nua_server.c b/libsofia-sip-ua/nua/nua_server.c index 4818c13c..8541c0de 100644 --- a/libsofia-sip-ua/nua/nua_server.c +++ b/libsofia-sip-ua/nua/nua_server.c @@ -415,6 +415,7 @@ nua_stack_respond(nua_t *nua, nua_handle_t *nh, nua_server_request_t *sr; tagi_t const *t; msg_t const *request = NULL; + int prack_pending = 0; t = tl_find_last(tags, nutag_with); @@ -425,8 +426,16 @@ nua_stack_respond(nua_t *nua, nua_handle_t *nh, if (request && sr->sr_request.msg == request) break; /* nua_respond() to INVITE can be used without NUTAG_WITH() */ - if (!t && sr->sr_method == sip_method_invite) + if (!t && sr->sr_method == sip_method_invite) { + if (prack_pending) { + nua_stack_event(nua, nh, NULL, nua_i_error, + 500, "Server Internal Error", NULL); + return; + } break; + } + else if (!t && sr->sr_method == sip_method_prack) + prack_pending = 1; } if (sr == NULL) {