From ac90c1d1031f41018ab47e08cd2209f5e78e1dac Mon Sep 17 00:00:00 2001 From: hno <> Date: Mon, 27 Jan 2003 15:08:04 +0000 Subject: [PATCH] Bugzilla 506: log_mime_hdrs output garbage on overly long request headers --- src/logfile.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/logfile.cc b/src/logfile.cc index 24aa7dfd1d..0b62277edd 100644 --- a/src/logfile.cc +++ b/src/logfile.cc @@ -1,5 +1,5 @@ /* - * $Id: logfile.cc,v 1.13 2003/01/23 00:37:23 robertc Exp $ + * $Id: logfile.cc,v 1.14 2003/01/27 08:08:04 hno Exp $ * * DEBUG: section 50 Log file handling * AUTHOR: Duane Wessels @@ -162,6 +162,11 @@ logfilePrintf(va_alist) fmt = va_arg(args, char *); #endif s = vsnprintf(buf, 8192, fmt, args); + if (s > 8192) { + s = 8192; + if (fmt[strlen(fmt) - 1] == '\n') + buf[8191] = '\n'; + } logfileWrite(lf, buf, (size_t) s); va_end(args); } -- 2.47.3