]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
make sure tmp_error_buf is big enough to hold two URLs
authorwessels <>
Sat, 6 Apr 1996 06:21:11 +0000 (06:21 +0000)
committerwessels <>
Sat, 6 Apr 1996 06:21:11 +0000 (06:21 +0000)
use pointers rather than arrays

src/errorpage.cc
src/main.cc

index 0641d8e9c45e900b223203524a2ccb71eddb76cc..28c2dac851560df692255c30c9de525141d8906d 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: errorpage.cc,v 1.13 1996/04/04 18:41:23 wessels Exp $ */
+/* $Id: errorpage.cc,v 1.14 1996/04/05 23:21:11 wessels Exp $ */
 
 /* DEBUG: Section 4             cached_error: Error printing routines */
 
@@ -98,13 +98,18 @@ error_data ErrorData[] =
 };
 
 /* GLOBAL */
-char tmp_error_buf[BUFSIZ];
+char *tmp_error_buf;
 
 /* LOCAL */
-static char tbuf[BUFSIZ];
+static char *tbuf;
 
 int log_errors = 1;
 
+void errorInitialize() {
+       tmp_error_buf = (char *) xmalloc(MAX_URL * 4);
+       tbuf = (char *) xmalloc(MAX_URL * 3);
+}
+
 
 void cached_error_entry(entry, type, msg)
      StoreEntry *entry;
@@ -146,7 +151,7 @@ char *cached_error_url(url, method, type, address, code, msg)
 {
     int index;
 
-    tmp_error_buf[0] = '\0';
+    *tmp_error_buf = '\0';
     if (type == ERR_MIN || type > ERR_MAX)
        fatal_dump("cached_error_url: type out of range.");
     index = (int) (type - ERR_MIN);
@@ -191,7 +196,7 @@ char *cached_error_request(request, type, address, code)
 {
     int index;
 
-    tmp_error_buf[0] = '\0';
+    *tmp_error_buf = '\0';
     if (type == ERR_MIN || type > ERR_MAX)
        fatal_dump("cached_error_url: type out of range.");
     index = (int) (type - ERR_MIN);
index f50f57ad6cee8c5d3c6fc0f2bdae02e06169455b..c61741751e32a9e13ab43f826b56ae29fe10df83 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: main.cc,v 1.19 1996/04/04 22:01:54 wessels Exp $ */
+/* $Id: main.cc,v 1.20 1996/04/05 23:21:12 wessels Exp $ */
 
 /* DEBUG: Section 1             main: startup and main loop */
 
@@ -53,6 +53,8 @@ int main(argc, argv)
     int n;                     /* # of GC'd objects */
     time_t last_maintain = 0;
 
+    errorInitialize();
+
     cached_starttime = getCurrentTime();
     failure_notify = fatal_dump;