]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bugzilla 506: log_mime_hdrs output garbage on overly long request headers
authorhno <>
Mon, 27 Jan 2003 15:08:04 +0000 (15:08 +0000)
committerhno <>
Mon, 27 Jan 2003 15:08:04 +0000 (15:08 +0000)
src/logfile.cc

index 24aa7dfd1dc29acfd873c9789ee731eab7f8ee6f..0b62277edd027418199e89c4a97d19ac8bf956d5 100644 (file)
@@ -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);
 }