+Thu Jun 27 20:07:27 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * Buffer overflow with CUMODE command's mode->mode character
+ conversion. Reported by Ville Räsänen. Affected file
+ lib/silcutil/silcutil.c.
+
Thu Jun 27 16:54:33 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Allow heartbeat packets to go disabled connections anyway.
if (mode & SILC_CHANNEL_MODE_SILENCE_OPERS)
strncat(string, "M", 1);
- if (mode & SILC_CHANNEL_MODE_CIPHER)
- strncat(string, cipher, strlen(cipher));
+ if (mode & SILC_CHANNEL_MODE_CIPHER) {
+ if (strlen(cipher) + strlen(string) < sizeof(string))
+ strncat(string, cipher, strlen(cipher));
+ }
- if (mode & SILC_CHANNEL_MODE_HMAC)
- strncat(string, hmac, strlen(hmac));
+ if (mode & SILC_CHANNEL_MODE_HMAC) {
+ if (strlen(hmac) + strlen(string) < sizeof(string))
+ strncat(string, hmac, strlen(hmac));
+ }
/* Rest of mode is ignored */
char *silc_client_chumode(SilcUInt32 mode)
{
- char string[4];
+ char string[64];
if (!mode)
return NULL;
char *silc_client_chumode_char(SilcUInt32 mode)
{
- char string[4];
+ char string[64];
if (!mode)
return NULL;