summaryrefslogtreecommitdiffstats
path: root/contrib/bind9/lib/isc/heap.c
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2010-03-03 05:45:24 +0000
committerdougb <dougb@FreeBSD.org>2010-03-03 05:45:24 +0000
commitc52afe031a68f8430df41e7ab57296c1daefff9b (patch)
tree62d02001f69506ed0ec63ea339614e3658d10ebf /contrib/bind9/lib/isc/heap.c
parente901048f7a904e924f01096cc6dd1e754aba05a5 (diff)
downloadFreeBSD-src-c52afe031a68f8430df41e7ab57296c1daefff9b.zip
FreeBSD-src-c52afe031a68f8430df41e7ab57296c1daefff9b.tar.gz
Upgrade to version 9.6.2. This version includes all previously released
security patches to the 9.6.1 version, as well as many other bug fixes. This version also incorporates a different fix for the problem we had patched in contrib/bind9/bin/dig/dighost.c, so that file is now back to being the same as the vendor version. Due to the fact that the DNSSEC algorithm that will be used to sign the root zone is only included in this version and in 9.7.x those who wish to do validation MUST upgrade to one of these prior to July 2010.
Diffstat (limited to 'contrib/bind9/lib/isc/heap.c')
-rw-r--r--contrib/bind9/lib/isc/heap.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/bind9/lib/isc/heap.c b/contrib/bind9/lib/isc/heap.c
index 91d78c0..dc32100 100644
--- a/contrib/bind9/lib/isc/heap.c
+++ b/contrib/bind9/lib/isc/heap.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2007, 2010 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1997-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: heap.c,v 1.37 2007/10/19 17:15:53 explorer Exp $ */
+/* $Id: heap.c,v 1.37.240.3 2010/02/04 23:47:46 tbox Exp $ */
/*! \file
* Heap implementation of priority queues adapted from the following:
@@ -186,15 +186,17 @@ sink_down(isc_heap_t *heap, unsigned int i, void *elt) {
isc_result_t
isc_heap_insert(isc_heap_t *heap, void *elt) {
- unsigned int i;
+ unsigned int new_last;
REQUIRE(VALID_HEAP(heap));
- i = ++heap->last;
- if (heap->last >= heap->size && !resize(heap))
+ new_last = heap->last + 1;
+ RUNTIME_CHECK(new_last > 0); /* overflow check */
+ if (new_last >= heap->size && !resize(heap))
return (ISC_R_NOMEMORY);
+ heap->last = new_last;
- float_up(heap, i, elt);
+ float_up(heap, new_last, elt);
return (ISC_R_SUCCESS);
}
OpenPOWER on IntegriCloud