From 16ccd387f153b3e836f068b9ec4e032979d99393 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Tue, 5 Jun 2007 06:23:07 +0000 Subject: [PATCH] Fix buffer overrun by one in the setting of l_prefix/l_prefix2 --- src/log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/log.c b/src/log.c index f358690..a696fd3 100644 --- a/src/log.c +++ b/src/log.c @@ -2,7 +2,7 @@ * Copyright (C) 1995-2007, Index Data ApS * See the file LICENSE for details. * - * $Id: log.c,v 1.52 2007-06-05 05:58:16 adam Exp $ + * $Id: log.c,v 1.53 2007-06-05 06:23:07 adam Exp $ */ /** @@ -235,7 +235,7 @@ void yaz_log_init_level(int level) void yaz_log_init_prefix(const char *prefix) { if (prefix && *prefix) - sprintf(l_prefix, "%.511s ", prefix); + yaz_snprintf(l_prefix, sizeof(l_prefix), "%s ", prefix); else *l_prefix = 0; } @@ -243,7 +243,7 @@ void yaz_log_init_prefix(const char *prefix) void yaz_log_init_prefix2(const char *prefix) { if (prefix && *prefix) - sprintf(l_prefix2, "%.511s ", prefix); + yaz_snprintf(l_prefix2, sizeof(l_prefix2), "%s ", prefix); else *l_prefix2 = 0; } -- 1.7.10.4