Bug #239

Zlib::Deflate#params can corrupt output

Added by drbrain (Eric Hodel) almost 4 years ago. Updated about 1 year ago.

[ruby-core:17675]
Status:Closed Start date:07/09/2008
Priority:Normal Due date:
Assignee:- % Done:

100%

Category:-
Target version:-
ruby -v:

Description

It seems that Zlib::Deflate#params needs to flush the input buffer.

Example output from running the attached test script:

$ ruby18 -v ztest.rb
ruby 1.8.7 (2008-06-25 revision 17572) [i686-darwin9.3.0]
deflated: "x\001\000\n\000\365\377abcdefghij\002,;'7/\277"
ztest.rb:16: warning: attempt to close unfinished zstream; reset forced.
ztest.rb:16:in `inflate': buffer error (Zlib::BufError)
	from ztest.rb:16
$ ruby19 -v ztest.rb
ruby 1.9.0 (2008-06-26 revision 15873) [i686-darwin9.3.0]
deflated: "x\x01\x00\n\x00\xF5\xFFabcdefghij\x02,;'7/\xBF"
ztest.rb:16: warning: attempt to close unfinished zstream; reset forced.
ztest.rb:16:in `inflate': buffer error (Zlib::BufError)
	from ztest.rb:16:in `<main>'
$

ztest.rb - Zlib::Deflate#params test script (392 Bytes) drbrain (Eric Hodel), 07/09/2008 08:55 am

Associated revisions

Revision 18029
Added by mame (Yusuke Endoh) almost 4 years ago

* ext/zlib/zlib.c (rb_deflate_params): flush before deflateParams. [ruby-core:17675]

History

Updated by mame (Yusuke Endoh) almost 4 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100
Applied in changeset r18029.

Also available in: Atom PDF