From: Pat Thoyts Date: Mon, 11 Aug 2008 22:14:26 +0000 (+0000) Subject: Merged fix for zlib crc check from Tcl X-Git-Tag: vfs-1-4~20 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=d6d10799a7a09ee13844c7917b752178cfe2dfc6;p=tclvfs Merged fix for zlib crc check from Tcl --- diff --git a/ChangeLog b/ChangeLog index 260649a..fb19aaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-11 Pat Thoyts + + * http2.6/http.tcl: Merged zlib crc fix from Tcl. + 2008-04-30 Pat Thoyts * win/makefile.vc: Updated the NMAKE build files. diff --git a/http2.6/http.tcl b/http2.6/http.tcl index 69f883a..447cbfe 100644 --- a/http2.6/http.tcl +++ b/http2.6/http.tcl @@ -25,10 +25,11 @@ # 2.6.8 Merged with core version in 8.5.2 and 8.4.19 and above changes. # Core is 2.7, this v2.6.8 has defaultKeepalive 1 and different # default -useragent. +# 2.6.9 Merged fix for zlib crc check on 64bit systems. package require Tcl 8.4 # keep this in sync with pkgIndex.tcl -package provide http 2.6.8 +package provide http 2.6.9 namespace eval http { # Allow resourcing to not clobber existing data @@ -1428,8 +1429,8 @@ proc http::Gunzip {data} { binary scan [string range $data end-7 end] ii crc size set inflated [zlib inflate [string range $data $pos end-8]] - - if { $crc != [set chk [zlib crc32 $inflated]] } { + set chk [zlib crc32 $inflated] + if { ($crc & 0xffffffff) != ($chk & 0xffffffff)} { return -code error "invalid data: checksum mismatch $crc != $chk" } return $inflated diff --git a/http2.6/pkgIndex.tcl b/http2.6/pkgIndex.tcl index 89a17fa..7e44dd0 100644 --- a/http2.6/pkgIndex.tcl +++ b/http2.6/pkgIndex.tcl @@ -4,5 +4,5 @@ # package ifneeded http 2.6 [list tclPkgSetup $dir http 2.6 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister}}}] # if {![package vsatisfies [package provide Tcl] 8.4]} {return} -package ifneeded http 2.6.8 [list source [file join $dir http.tcl]] +package ifneeded http 2.6.9 [list source [file join $dir http.tcl]]