From 5647e57dc1c3a5abe13cbe222ca7ea08a9b91dce Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 12 Mar 2015 20:58:04 +0100 Subject: [PATCH] avoid crash if trying to download a Chat message without associated file --- coreapi/chat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coreapi/chat.c b/coreapi/chat.c index e97073368..37cafbde6 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -1468,6 +1468,10 @@ void linphone_chat_message_download_file(LinphoneChatMessage *message) { const char *url=message->external_body_url; char* ua = ms_strdup_printf("%s/%s", linphone_core_get_user_agent_name(), linphone_core_get_user_agent_version()); + if (url == NULL) { + ms_error("Cannot download file from chat message [%p] because url is NULL",message); + return; + } uri=belle_generic_uri_parse(url); message->http_request=belle_http_request_create("GET",