|
2017-02-26
| ||
| 15:34 | • Closed ticket [25842c161f]: zlib deflate streaming raises error in case of zero ... artifact: 982f175715 user: dkf | |
| 15:33 | [25842c161f] Ensure that finalization of a zlib stream works. check-in: 6b926caddb user: dkf tags: trunk | |
| 15:32 | [25842c161f] Ensure that finalization of a zlib stream works. check-in: 23af13880c user: dkf tags: core-8-6-branch | |
|
2017-02-11
| ||
| 05:09 | • Ticket [25842c161f] zlib deflate streaming raises error in case of zero length i... artifact: b4705dbb2b user: aspect | |
| 05:06 | zlib stream finalize calls deflate with no input - this case (and this case only) must be allowed. ... check-in: be8c38b974 user: aspect tags: bug-25842c161f | |
|
2016-11-21
| ||
| 16:36 | • Open ticket [25842c161f]: zlib deflate streaming raises error in case of zero le... artifact: 66595a94c1 user: apnadkarni | |
|
2016-09-03
| ||
| 08:44 | • Ticket [25842c161f]: 5 changes artifact: b7ac02ec35 user: aspect | |
|
2016-02-03
| ||
| 15:30 | • Closed ticket [25842c161f]. artifact: dcc28099a7 user: dkf | |
| 15:29 | [25842c161] Prevent zero-length compress actions in [zlib] streaming API. check-in: c1aff52ef3 user: dkf tags: trunk | |
| 15:03 | • Ticket [25842c161f] zlib deflate streaming raises error in case of zero length i... artifact: f099ba6d19 user: pointsman | |
| 14:56 | • New ticket [25842c161f]. artifact: a3f1510abd user: pointsman | |
zlib deflate streaming raises error in case of zero length input
Closed / Fixed25842c161fd621d8d111430a3637688f55aeaa94Created 11 years agoUpdated 10 years ago
Descriptionplain2016-02-03 14:56:29
This two line script set zlib [zlib stream deflate] $zlib put "" raises error "buffer error". At least, the documentation should say, that the cmd raises this error, if feeded with zero length input, if this is in fact the desired behaviour. I'd say, that should do nothing, gracefully.
Referenced by3
6b926caddb[25842c161f] Ensure that finalization of a zlib stream works. check-in2017-02-26 15:33:0423af13880c[25842c161f] Ensure that finalization of a zlib stream works. check-in2017-02-26 15:32:11be8c38b974zlib stream finalize calls deflate with no input - this case (and this case only) must be allowed. Fixes 2nd issue in [25842c161f], introduced by [c1aff52ef3] check-in2017-02-11 05:06:43
pointsmanplain2016-02-03 15:03:37
Futher note: set zlib [zlib stream deflate] $zlib get does nothing, gracefully.
dkfhtml2016-02-03 15:30:59
Code was excessively smartass. Made simpler and added a specific step to stop this foolishness.
aspectplain2016-09-03 08:44:05
This patch has broken finalizing streams with [$zlib put -finalize ""] or [zlib finalize]:
package require zlib
set t1 [
set c [zlib stream gzip]
$c put abcdeEDCBA..
$c finalize
$c get
]
set t2 [
set c [zlib stream gzip]
$c put -finalize abcdeEDCBA..
$c get
]
puts [expr {$t1 eq $t2}]
# => 0
Here $t2 is the correct stream, but $t1 is truncated.
apnadkarniplain2016-11-21 16:36:34
Marked as open as I also ran into the the brokenness logged by aspect in the previous comment. The issue seems to be tclZlib.c line 1210:
if (size == 0) { return TCL_OK; }
Since finalize calls with zero length data that line returns.
aspectplain2017-02-11 05:09:58
Added test and fix in [bug-25842c161f]. The API feels fragile with all these changes going on, but that's largely (as dkf observes) due to zlib's weird rules not mapping well to what Tcl wants from a channel layer.
dkfhtml2017-02-26 15:34:55
Branch committed to main release branches; thanks for the test cases (which I tweaked so that they were a little less mysterious when they failed).
Log in (anonymous is fine) to add a comment.