|
2008-08-12
| ||
| 04:31 | • Closed ticket [2046486fff]: bogus CRC mismatches in ::http::Gunzip on 64bit arch... artifact: 631617f7b3 user: patthoyts | |
|
2008-08-11
| ||
| 22:56 | • Ticket [2046486fff]: 4 changes artifact: e559504cbe user: dgp | |
| 22:52 | • Open ticket [2046486fff]. artifact: 763f661e9c user: dgp | |
| 21:40 | • Closed ticket [2046486fff]. artifact: 93de8f3a50 user: patthoyts | |
| 21:17 | • Ticket [2046486fff]: 2 changes artifact: 1c98e8505c user: patthoyts | |
| 21:03 | • Ticket [2046486fff]: 4 changes artifact: d019e0e305 user: matzek | |
| 21:03 | • Add attachment http.tcl.patch-1.67 to ticket [2046486fffffffff|2046486f... artifact: 02557800c3 user: matzek | |
| 14:03 | • New ticket [2046486fff] bogus CRC mismatches in ::http::Gunzip on 64bit architec... artifact: f9baefd901 user: matzek | |
bogus CRC mismatches in ::http::Gunzip on 64bit architecture
Closed / Fixed2046486fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2008-08-11 14:03:49
Hi *,
[binary scan i] delivers signed integers, while [zlib crc32] delivers unsigned integers. The appended patch will correct the crc from binary scan.
Simple test case: create gzipped data that delivers such a CRC, i.e.
$ dd if=/dev/zero bs=1 count=128 | gzip -1 > 128zeros.gz
then run this small script:
----
package r http 2.7
set fh [open 128zeros.gz r]
fconfigure $fh -encoding binary -translation binary
set data [read $fh]
close $fh
::http::Gunzip $data
----
Result without patch:
invalid data: checksum mismatch -1029113187 != 3265854109
while executing
"::http::Gunzip $data"
kind regards
-- Matthias Kraft
matzekplain2008-08-11 21:03:49
File Added - 288104: http.tcl.patch-1.67
patthoyts Ticket [2046486fff]: 2 changes
[History diff]2008-08-11 21:17:48
patthoytsplain2008-08-11 21:40:47
Logged In: YES user_id=202636 Originator: NO The problem is treating the crc and size fields in the gzip header as signed when they should be unsigned. Fixed simply by using binary scan $header iuiu crc size to use them as unsigned values. Committed to HEAD and 8.5 branch (not relevant to 8.4)
dgpplain2008-08-11 22:52:32
Logged In: YES user_id=80530 Originator: NO This has been fixed in http 2.7.1. Is the bug also present in http 2.5.5 ? If so, is there any reasonable way to fix it to make an http 2.5.6 that can still be used in a Tcl 8.4 interp?
dgpplain2008-08-11 22:56:27
Logged In: YES user_id=80530 Originator: NO For the sake of the ActiveTcl 8.4 distributions that support Tcl Modules, an http 2.7.1 that fixes this bug and doesn't rely on Tcl 8.5 would be a good idea. Without that, AT 8.4 will continue to get buggy http 2.7 by default.
patthoytsplain2008-08-12 04:31:56
Logged In: YES user_id=202636 Originator: NO OK. making use of the binary scan like this isn't necessary so changed to apply a 32bit mask in the comparison instead which remains 8.4 compliant.
Log in (anonymous is fine) to add a comment.
Attachments:
- http.tcl.patch-1.67 [download] added by matzek on 2008-08-11 21:03:49. [details]