From f8ad159142143dfc784596c33de654ff6fb0562f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 13 Feb 2002 00:41:06 +0000 Subject: [PATCH] Oops, previous commit would cause sprintf() to overrun the malloc()ed buffer by exactly one character. Add some slack. Sponsored by: DARPA, NAI Labs git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@52 185d5e19-27fe-0310-9dcf-9bff6b9f3609 --- lib/openpam_log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/openpam_log.c b/lib/openpam_log.c index 4564174..b15c6e3 100644 --- a/lib/openpam_log.c +++ b/lib/openpam_log.c @@ -74,7 +74,7 @@ _openpam_log(int level, const char *func, const char *fmt, ...) va_start(ap, fmt); for (len = strlen(fmt); len > 0 && isspace(fmt[len]); len--) /* nothing */; - if ((format = malloc(strlen(func) + len + 8)) != NULL) { + if ((format = malloc(strlen(func) + len + 16)) != NULL) { sprintf(format, "in %s(): %.*s\n", func, len, fmt); vsyslog(priority, format, ap); #ifdef DEBUG