From c8090cb664f24baa0b3b9790de90dd8dd7005671 Mon Sep 17 00:00:00 2001
From: Simon Morlat <simon.morlat@linphone.org>
Date: Mon, 3 Feb 2025 13:38:28 +0100
Subject: [PATCH] Fix crash when there is no "algo" parameter in a Authenticate
 header.

---
 src/provider.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/provider.c b/src/provider.c
index eda253be..7727c506 100644
--- a/src/provider.c
+++ b/src/provider.c
@@ -1205,6 +1205,8 @@ static void belle_sip_provider_update_or_create_auth_context(belle_sip_provider_
 
 	if (belle_sip_stack_check_digest_compatibility(p->stack, authenticate) == -1) return;
 
+	if (algo == NULL) algo = "MD5";
+
 	for (auth_context_it = auth_context_lst =
 	         belle_sip_provider_get_auth_context_by_realm_or_call_id(p, call_id, from_uri, realm);
 	     auth_context_it != NULL; auth_context_it = auth_context_it->next) {
-- 
GitLab