From 1056ae922fc0112d4b9fcaa2ab9e00f82af56862 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Sat, 9 Feb 2002 12:50:01 +0000 Subject: [PATCH] updates. --- CHANGES | 5 +++++ apps/irssi/src/silc/core/client_ops.c | 3 +++ lib/silcclient/client_ops_example.c | 5 +++-- lib/silcclient/silcapi.h | 4 +++- lib/silccore/silcchannel.c | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index f97dccba..ccde2997 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Sat Feb 9 14:54:33 EET 2002 Pekka Riikonen + + * Allow zero length channel messages inside the Channel Message + Payload. Affected file lib/silccore/silcchannel.c. + Thu Feb 7 10:12:25 CET 2002 Pekka Riikonen * Fixed CUMODE_CHANGE notify handling to change the mode of diff --git a/apps/irssi/src/silc/core/client_ops.c b/apps/irssi/src/silc/core/client_ops.c index 64cdf7e8..6d451459 100644 --- a/apps/irssi/src/silc/core/client_ops.c +++ b/apps/irssi/src/silc/core/client_ops.c @@ -87,6 +87,9 @@ void silc_channel_message(SilcClient client, SilcClientConnection conn, SILC_LOG_DEBUG(("Start")); + if (!msg) + return; + server = conn == NULL ? NULL : conn->context; chanrec = silc_channel_find_entry(server, channel); if (!chanrec) diff --git a/lib/silcclient/client_ops_example.c b/lib/silcclient/client_ops_example.c index 87765460..d472a057 100644 --- a/lib/silcclient/client_ops_example.c +++ b/lib/silcclient/client_ops_example.c @@ -22,8 +22,9 @@ silc_say(SilcClient client, SilcClientConnection conn, } -/* Message for a channel. The `sender' is the sender of the message - The `channel' is the channel. */ +/* Message for a channel. The `sender' is the sender of the message + The `channel' is the channel. The `msg' is the message. Note that + `msg' maybe NULL. */ static void silc_channel_message(SilcClient client, SilcClientConnection conn, diff --git a/lib/silcclient/silcapi.h b/lib/silcclient/silcapi.h index 1cb8801c..0d6244b2 100644 --- a/lib/silcclient/silcapi.h +++ b/lib/silcclient/silcapi.h @@ -239,7 +239,8 @@ typedef struct { SilcClientMessageType type, char *msg, ...); /* Message for a channel. The `sender' is the sender of the message - The `channel' is the channel. */ + The `channel' is the channel. The `msg' is the message. Note that + `msg' maybe NULL. */ void (*channel_message)(SilcClient client, SilcClientConnection conn, SilcClientEntry sender, SilcChannelEntry channel, SilcMessageFlags flags, char *msg); @@ -1195,6 +1196,7 @@ SilcClientCommandContext silc_client_command_dup(SilcClientCommandContext ctx); * * Finds and returns a pointer to the command list. Return NULL if the * command is not found. See the `command.[ch]' for the command list. + * Command names are not case-sensitive. * ***/ SilcClientCommand silc_client_command_find(SilcClient client, diff --git a/lib/silccore/silcchannel.c b/lib/silccore/silcchannel.c index 6bab3c22..fef7a197 100644 --- a/lib/silccore/silcchannel.c +++ b/lib/silccore/silcchannel.c @@ -335,7 +335,7 @@ silc_channel_message_payload_parse(unsigned char *payload, if (ret == -1) goto err; - if (new->data_len < 1 || new->data_len > buffer.len) { + if (new->data_len > buffer.len) { SILC_LOG_ERROR(("Incorrect channel message payload in packet, " "packet dropped")); goto err; -- 2.43.0