From 4205b80e29d7f8922ac23d5a5b193e50f4ed2f94 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Fri, 8 Apr 2011 19:17:16 +0000 Subject: 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@ --- sys/net/zlib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/net') 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"; -- cgit v1.2.3