From d6fec902f5ecce2849f1ea7a2fff073df3ea8db9 Mon Sep 17 00:00:00 2001 From: Sebastian Hammer Date: Wed, 6 Dec 1995 09:51:27 +0000 Subject: [PATCH 1/1] Fixed the log-prefix buffer - it was too small and the setup code lacked a bounds-check. --- util/log.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/util/log.c b/util/log.c index 134d7fd..8102d2b 100644 --- a/util/log.c +++ b/util/log.c @@ -4,7 +4,11 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: log.c,v $ - * Revision 1.9 1995-09-29 17:12:34 quinn + * Revision 1.10 1995-12-06 09:51:27 quinn + * Fixed the log-prefix buffer - it was too small and the setup code lacked + * a bounds-check. + * + * Revision 1.9 1995/09/29 17:12:34 quinn * Smallish * * Revision 1.8 1995/09/27 15:03:02 quinn @@ -71,7 +75,7 @@ static int l_level = LOG_DEFAULT_LEVEL; static FILE *l_file = stderr; -static char l_prefix[30] = "log"; +static char l_prefix[512] = "log"; static struct { int mask; @@ -107,7 +111,7 @@ void log_init(int level, const char *prefix, const char *name) { l_level = level; if (prefix && *prefix) - strcpy(l_prefix, prefix); + sprintf(l_prefix, "%.512s", prefix); if (!name || !*name || l_file != stderr) return; if (!(l_file = fopen(name, "a"))) -- 1.7.10.4