From 6c051d97ee2bbe7a7a9d761a1073a4bf67d307a3 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 28 May 2007 20:18:59 +0000 Subject: [PATCH] Fixed nickname formatting crash when normalized nick is NULL (happens after JOIN notify and its following WHOIS). --- CHANGES | 5 ++++- lib/silcclient/client_entry.c | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 914b012c..cda01761 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,7 @@ -Mon May 28 21:21:39 EEST 2007 Pekka Riikonen +Mon May 28 23:21:39 EEST 2007 Pekka Riikonen + + * Fixed nickname formatting crash when updating existing + client entry. Affected file is lib/silcclient/client_entry.c. * Fixed MIME object encoding in attribute payload encoding. Affected file is lib/silccore/silcattrs.c. diff --git a/lib/silcclient/client_entry.c b/lib/silcclient/client_entry.c index a6dc88d5..a97adecd 100644 --- a/lib/silcclient/client_entry.c +++ b/lib/silcclient/client_entry.c @@ -1125,7 +1125,8 @@ SilcClientEntry silc_client_nickname_format(SilcClient client, } /* Is the requested client formatted already */ - if (!silc_utf8_strcasecmp(client_entry->nickname, + if (client_entry->nickname_normalized && + !silc_utf8_strcasecmp(client_entry->nickname, client_entry->nickname_normalized)) formatted = TRUE; @@ -1142,7 +1143,7 @@ SilcClientEntry silc_client_nickname_format(SilcClient client, unformatted = entry; break; } - } + } /* If there are no other unformatted clients and the requested client is unformatted, just return it. */ @@ -1151,7 +1152,7 @@ SilcClientEntry silc_client_nickname_format(SilcClient client, return client_entry; } - /* If priority formatting then the requested client will get the + /* If priority formatting then the requested client will get the unformatted nickname, and the unformatted client will get a new formatted nickname. */ if (priority) { @@ -1161,7 +1162,7 @@ SilcClientEntry silc_client_nickname_format(SilcClient client, &cp)) return NULL; - silc_snprintf(client_entry->nickname, sizeof(client_entry->nickname), + silc_snprintf(client_entry->nickname, sizeof(client_entry->nickname), cp); silc_free(cp); } -- 2.24.0