diff options
author | 2015-01-16 01:10:10 +0000 | |
---|---|---|
committer | 2015-01-16 01:10:10 +0000 | |
commit | 595fd91c35f0d4c7a9e3864bc48226e9b50e0b4b (patch) | |
tree | 2266df9139d8897e153b0f0b0d41ed595496ccdc /usr.sbin/nsd/udb.c | |
parent | Since <netdb.h> soon won't include <sys/param.h>, MAXHOSTNAMELEN may (diff) | |
download | wireguard-openbsd-595fd91c35f0d4c7a9e3864bc48226e9b50e0b4b.tar.xz wireguard-openbsd-595fd91c35f0d4c7a9e3864bc48226e9b50e0b4b.zip |
Merge in a commit from upstream..
- Fix bug#637: fix that nsd.db grows limitlessly, an off by one
on one megabyte free chunks, created during AXFRs of large zones,
that caused the one megabyte chunk to be leaked.
ok sthen@
Diffstat (limited to 'usr.sbin/nsd/udb.c')
-rw-r--r-- | usr.sbin/nsd/udb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/nsd/udb.c b/usr.sbin/nsd/udb.c index 9b31fcfc310..49532516a99 100644 --- a/usr.sbin/nsd/udb.c +++ b/usr.sbin/nsd/udb.c @@ -1309,7 +1309,7 @@ udb_void udb_alloc_space(udb_alloc* alloc, size_t sz) return ret + sizeof(udb_chunk_d); /* ptr to data */ } /* see if we can subdivide a larger chunk */ - for(e2 = exp+1; e2 < UDB_ALLOC_CHUNKS_MAX; e2++) + for(e2 = exp+1; e2 <= UDB_ALLOC_CHUNKS_MAX; e2++) if(alloc->disk->free[e2-UDB_ALLOC_CHUNK_MINEXP]) { udb_void big, ret; /* udb_chunk_d */ alloc->udb->glob_data->dirty_alloc = udb_dirty_fl; @@ -1344,7 +1344,7 @@ have_free_for(udb_alloc* alloc, int exp) int e2; if(alloc->disk->free[exp-UDB_ALLOC_CHUNK_MINEXP]) return exp; - for(e2 = exp+1; e2 < UDB_ALLOC_CHUNKS_MAX; e2++) + for(e2 = exp+1; e2 <= UDB_ALLOC_CHUNKS_MAX; e2++) if(alloc->disk->free[e2-UDB_ALLOC_CHUNK_MINEXP]) { return e2; } |