summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nsd/udb.c
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2018-05-17 18:58:40 +0000
committerflorian <florian@openbsd.org>2018-05-17 18:58:40 +0000
commitbfd0b123b235d9c5cebc3acd3ab4fe00dfd2c471 (patch)
treef6949943ba96c1e3a1b1b3fce36b7b5465f14eff /usr.sbin/nsd/udb.c
parentBytes only have eight bits, not nine. (diff)
downloadwireguard-openbsd-bfd0b123b235d9c5cebc3acd3ab4fe00dfd2c471.tar.xz
wireguard-openbsd-bfd0b123b235d9c5cebc3acd3ab4fe00dfd2c471.zip
update to nsd 4.1.21
OK sthen
Diffstat (limited to 'usr.sbin/nsd/udb.c')
-rw-r--r--usr.sbin/nsd/udb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/nsd/udb.c b/usr.sbin/nsd/udb.c
index 3e91c7c8b4c..1b41ab91156 100644
--- a/usr.sbin/nsd/udb.c
+++ b/usr.sbin/nsd/udb.c
@@ -62,7 +62,8 @@ chunk_get_last(void* base, udb_void chunk, int exp)
static void
chunk_set_last(void* base, udb_void chunk, int exp, uint8_t value)
{
- *((uint8_t*)UDB_REL(base, chunk+(1<<exp)-1)) = value;
+ assert(exp >= 0 && exp <= 63);
+ *((uint8_t*)UDB_REL(base, chunk+((uint64_t)1<<exp)-1)) = value;
}
/** create udb_base from a file descriptor (must be at start of file) */
@@ -627,6 +628,7 @@ int udb_exp_size(uint64_t a)
i >>= 1;
x ++;
}
+ assert( x>=0 && x<=63);
assert( ((uint64_t)1<<x) >= a);
assert( x==0 || ((uint64_t)1<<(x-1)) < a);
return x;