diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 6b8a79661..e37d47c72 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1874,7 +1874,7 @@ static void apply_user_agent(LinphoneCore *lc){ void linphone_core_set_user_agent(LinphoneCore *lc, const char *name, const char *ver){ #if USE_BELLESIP char ua_string[256]; - snprintf(ua_string, sizeof(ua_string) - 1, "%s/%s", name, ver); + snprintf(ua_string, sizeof(ua_string) - 1, "%s/%s", name?name:"", ver?ver:""); if (lc->sal) { sal_set_user_agent(lc->sal, ua_string); sal_append_stack_string_to_user_agent(lc->sal); diff --git a/tester/message_tester.c b/tester/message_tester.c index 66c75df86..cf99c1013 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -33,9 +33,11 @@ void text_message_received(LinphoneCore *lc, LinphoneChatRoom *room, const Linph void message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage* message) { char* from=linphone_address_as_string(linphone_chat_message_get_from(message)); stats* counters; - ms_message("Message from [%s] is [%s] , external URL [%s]",from - ,linphone_chat_message_get_text(message) - ,linphone_chat_message_get_external_body_url(message)); + const char *text=linphone_chat_message_get_text(message); + const char *external_body_url=linphone_chat_message_get_external_body_url(message); + ms_message("Message from [%s] is [%s] , external URL [%s]",from?from:"" + ,text?text:"" + ,external_body_url?external_body_url:""); ms_free(from); counters = get_stats(lc); counters->number_of_LinphoneMessageReceived++;