Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/dist/bind/lib/isc Pull up revision 1.3 (requested by it...
details: https://anonhg.NetBSD.org/src/rev/840ccbc226b8
branches: netbsd-1-6
changeset: 528231:840ccbc226b8
user: lukem <lukem%NetBSD.org@localhost>
date: Fri Jun 28 11:56:05 2002 +0000
description:
Pull up revision 1.3 (requested by itojun in ticket #387):
Update to BIND 8.3.3. Fixes buffer overrun in resolver code.
diffstat:
dist/bind/lib/isc/logging.c | 28 +++++++++++++++++++++-------
dist/bind/lib/isc/memcluster.c | 37 ++++++++++++++++++++++++++++++-------
2 files changed, 51 insertions(+), 14 deletions(-)
diffs (167 lines):
diff -r 0a6b1ae0b2a7 -r 840ccbc226b8 dist/bind/lib/isc/logging.c
--- a/dist/bind/lib/isc/logging.c Fri Jun 28 11:55:56 2002 +0000
+++ b/dist/bind/lib/isc/logging.c Fri Jun 28 11:56:05 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: logging.c,v 1.2 2001/01/27 07:22:04 itojun Exp $ */
+/* $NetBSD: logging.c,v 1.2.2.1 2002/06/28 11:56:05 lukem Exp $ */
/*
* Copyright (c) 1996-1999 by Internet Software Consortium.
@@ -18,7 +18,7 @@
*/
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "Id: logging.c,v 8.28 2000/12/23 08:14:54 vixie Exp";
+static const char rcsid[] = "Id: logging.c,v 8.31 2001/06/18 14:44:03 marka Exp";
#endif /* not lint */
#include "port_before.h"
@@ -59,8 +59,9 @@
static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
-static char *level_text[] = { "info: ", "notice: ", "warning: ", "error: ",
- "critical: " };
+static const char *level_text[] = {
+ "info: ", "notice: ", "warning: ", "error: ", "critical: "
+};
static void
version_rename(log_channel chan) {
@@ -179,6 +180,19 @@
return (0);
}
+void
+log_close_debug_channels(log_context lc) {
+ log_channel_list lcl;
+ int i;
+
+ for (i = 0; i < lc->num_categories; i++)
+ for (lcl = lc->categories[i]; lcl != NULL; lcl = lcl->next)
+ if (lcl->channel->type == log_file &&
+ lcl->channel->out.file.stream != NULL &&
+ lcl->channel->flags & LOG_REQUIRE_DEBUG)
+ (void)log_close_stream(lcl->channel);
+}
+
FILE *
log_get_stream(log_channel chan) {
if (chan == NULL || chan->type != log_file) {
@@ -270,8 +284,8 @@
log_channel chan;
struct timeval tv;
struct tm *local_tm;
- char *category_name;
- char *level_str;
+ const char *category_name;
+ const char *level_str;
char time_buf[256];
char level_buf[256];
@@ -584,7 +598,7 @@
log_channel
log_new_file_channel(unsigned int flags, int level,
- char *name, FILE *stream, unsigned int versions,
+ const char *name, FILE *stream, unsigned int versions,
unsigned long max_size) {
log_channel chan;
diff -r 0a6b1ae0b2a7 -r 840ccbc226b8 dist/bind/lib/isc/memcluster.c
--- a/dist/bind/lib/isc/memcluster.c Fri Jun 28 11:55:56 2002 +0000
+++ b/dist/bind/lib/isc/memcluster.c Fri Jun 28 11:56:05 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: memcluster.c,v 1.2 2001/05/17 23:00:20 itojun Exp $ */
+/* $NetBSD: memcluster.c,v 1.2.2.1 2002/06/28 11:56:14 lukem Exp $ */
/*
* Copyright (c) 1997,1999 by Internet Software Consortium.
@@ -26,7 +26,7 @@
#if !defined(LINT) && !defined(CODECENTER)
-static const char rcsid[] = "Id: memcluster.c,v 8.20 2001/02/13 23:14:54 marka Exp";
+static const char rcsid[] = "Id: memcluster.c,v 8.23 2001/06/18 14:44:05 marka Exp";
#endif /* not lint */
#include "port_before.h"
@@ -69,7 +69,7 @@
const char * file;
int line;
#endif
- int size;
+ size_t size;
fence_t fencepost;
#endif
} memcluster_element;
@@ -175,6 +175,10 @@
#endif
void *ret;
+#if !defined(MEMCLUSTER_RECORD)
+ UNUSED(file);
+ UNUSED(line);
+#endif
if (freelists == NULL)
if (meminit(0, 0) == -1)
return (NULL);
@@ -337,12 +341,19 @@
size_t new_size = quantize(size);
#if defined (DEBUGGING_MEMCLUSTER)
memcluster_element *e;
+ memcluster_element *el;
#ifdef MEMCLUSTER_RECORD
- memcluster_element *prev, *el;
+ memcluster_element *prev;
#endif
- int fp;
+ fence_t fp;
char *p;
#endif
+
+#if !defined (MEMCLUSTER_RECORD)
+ UNUSED(file);
+ UNUSED(line);
+#endif
+
REQUIRE(freelists != NULL);
if (size == 0) {
@@ -475,7 +486,7 @@
for (i = 1; i <= max_size; i++) {
if ((e = activelists[i]) != NULL)
while (e != NULL) {
- fprintf(out, "%s:%d %#p:%d\n",
+ fprintf(out, "%s:%d %p:%d\n",
e->file != NULL ? e->file :
"<UNKNOWN>", e->line,
(char *)e + sizeof *e, e->size);
@@ -485,6 +496,18 @@
#endif
}
+int
+memactive(void) {
+ size_t i;
+
+ if (stats == NULL)
+ return (0);
+ for (i = 1; i <= max_size; i++)
+ if (stats[i].gets != 0)
+ return (1);
+ return (0);
+}
+
/* Private. */
/*
@@ -517,7 +540,7 @@
#if defined(DEBUGGING_MEMCLUSTER)
static void
check(unsigned char *a, int value, size_t len) {
- int i;
+ size_t i;
for (i = 0; i < len; i++)
INSIST(a[i] == value);
}
Home |
Main Index |
Thread Index |
Old Index