summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2011-04-08 19:17:15 +0000
committermatthew <matthew@openbsd.org>2011-04-08 19:17:15 +0000
commit55479dd96ff88f8c372ea4f0acf925adc5a60bab (patch)
tree6b94945fd50f9681fb5beba8c7344525039909a4
parentrename wiat channel to something less than 8 chars. (diff)
downloadwireguard-openbsd-55479dd96ff88f8c372ea4f0acf925adc5a60bab.tar.xz
wireguard-openbsd-55479dd96ff88f8c372ea4f0acf925adc5a60bab.zip
Fix a 64-bit arithmetic bug I stumbled upon while investigating our
handling of recursive IPComp payloads. (This code is way old and may go away soon in favor of using sys/lib/libz, but committing anyway as plans aren't finalized yet.) ok deraadt@
-rw-r--r--sys/net/zlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/zlib.c b/sys/net/zlib.c
index 6d2a95084a9..70b58c230b1 100644
--- a/sys/net/zlib.c
+++ b/sys/net/zlib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zlib.c,v 1.13 2007/11/26 09:28:33 martynas Exp $ */
+/* $OpenBSD: zlib.c,v 1.14 2011/04/08 19:17:15 matthew Exp $ */
/* $NetBSD: zlib.c,v 1.2 1996/03/16 23:55:40 christos Exp $ */
/*
@@ -3335,7 +3335,7 @@ int r;
break;
case LENS:
NEEDBITS(32)
- if (((~b) >> 16) != (b & 0xffff))
+ if ((((~b) >> 16) & 0xffff) != (b & 0xffff))
{
s->mode = BADB;
z->msg = "invalid stored block lengths";