diff options
author | 2014-03-13 02:00:22 +0000 | |
---|---|---|
committer | 2014-03-13 02:00:22 +0000 | |
commit | cbbc2d6cdd2f1bfa0d6618cbef3bebc5a2370302 (patch) | |
tree | 5bd7f7c862d70cb487a7f27dc7d876b4fa2de292 /usr.sbin/nsd/udb.c | |
parent | fix buffer overflows in icmp redirect handling introduced in rev 1.106 (diff) | |
download | wireguard-openbsd-cbbc2d6cdd2f1bfa0d6618cbef3bebc5a2370302.tar.xz wireguard-openbsd-cbbc2d6cdd2f1bfa0d6618cbef3bebc5a2370302.zip |
update to NSD 4.0.2, ok sthen@
Diffstat (limited to 'usr.sbin/nsd/udb.c')
-rw-r--r-- | usr.sbin/nsd/udb.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/nsd/udb.c b/usr.sbin/nsd/udb.c index 6c0ffe7d0c0..02c81973942 100644 --- a/usr.sbin/nsd/udb.c +++ b/usr.sbin/nsd/udb.c @@ -134,12 +134,17 @@ udb_base_create_fd(const char* fname, int fd, udb_walk_relptr_func walkfunc, if(g.hsize > UDB_HEADER_SIZE) { log_msg(LOG_WARNING, "%s: header size too large %d", fname, (int)g.hsize); - log_msg(LOG_WARNING, "attempting to continue..."); + goto fail; } if(g.clean_close != 0) { log_msg(LOG_WARNING, "%s: not cleanly closed %d", fname, (int)g.clean_close); - log_msg(LOG_WARNING, "attempting to continue..."); + goto fail; + } + if(g.dirty_alloc != 0) { + log_msg(LOG_WARNING, "%s: not cleanly closed (alloc:%d)", fname, + (int)g.dirty_alloc); + goto fail; } /* TODO check if too large (>4g on 32bit); mmap-usage would fail */ @@ -169,6 +174,7 @@ udb_base_create_fd(const char* fname, int fd, udb_walk_relptr_func walkfunc, /* init completion */ udb->glob_data = (udb_glob_d*)(udb->base+sizeof(uint64_t)); r = 0; + /* cannot be dirty because that is goto fail above */ if(udb->glob_data->dirty_alloc != udb_dirty_clean) r = 1; udb->alloc = udb_alloc_create(udb, (udb_alloc_d*)( |