shithub: riscv

Download patch

ref: 8ac28ac11cb9e96329e4d083208b3f13ee8d2b8a
parent: ffe862c5433716e81e88602864f7323ff40971c5
author: cinap_lenrek <[email protected]>
date: Fri Dec 19 22:34:40 EST 2014

flate: fix wrong adler32() length calculation (thanks qrstuv)

--- a/sys/src/libflate/inflatezlibblock.c
+++ b/sys/src/libflate/inflatezlibblock.c
@@ -61,7 +61,7 @@
 	if(ok != FlateOk)
 		return ok;
 
-	if(adler32(1, dst, bs.pos - dst) != ((bs.pos[0] << 24) | (bs.pos[1] << 16) | (bs.pos[2] << 8) | bs.pos[3]))
+	if(adler32(1, dst, bd.pos - dst) != ((bs.pos[0] << 24) | (bs.pos[1] << 16) | (bs.pos[2] << 8) | bs.pos[3]))
 		return FlateCorrupted;
 
 	return bd.pos - dst;