From 207bb27a0654ac6d6e999c4a7e67420471dfcdf2 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 17 Jul 2000 16:44:57 +0000 Subject: [PATCH] Buffer overflow bug fixe in silc_log_format. --- lib/silccore/silclog.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/silccore/silclog.c b/lib/silccore/silclog.c index aecd6bf5..0b1119fc 100644 --- a/lib/silccore/silclog.c +++ b/lib/silccore/silclog.c @@ -20,6 +20,9 @@ /* * $Id$ * $Log$ + * Revision 1.4 2000/07/17 16:44:57 priikone + * Buffer overflow bug fixe in silc_log_format. + * * Revision 1.3 2000/07/05 06:06:35 priikone * Global cosmetic change. * @@ -60,10 +63,11 @@ unsigned int log_fatal_size; char *silc_log_format(char *fmt, ...) { va_list args; - static char buf[1024]; + static char buf[8192]; + memset(buf, 0, sizeof(buf); va_start(args, fmt); - vsprintf(buf, fmt, args); + vsnprintf(buf, sizeof(buf) - 1, fmt, args); va_end(args); return strdup(buf); -- 2.43.0