From 9f2f1fcbc8fc896e234a1b2939ba660ec56b55f2 Mon Sep 17 00:00:00 2001 From: drbrain Date: Wed, 28 Aug 2013 20:36:21 +0000 Subject: * ext/zlib/zlib.c (zstream_run): Fix handling of deflate streams that need a dictionary but are being decompressed by Zlib::Inflate.inflate (which has no option to set a dictionary). Now Zlib::NeedDict is raised instead of crashing. [ruby-trunk - Bug #8829] * test/zlib/test_zlib.rb (TestZlibInflate): Test for the above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/zlib/test_zlib.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/zlib/test_zlib.rb b/test/zlib/test_zlib.rb index 81d440f846..3122e7769e 100644 --- a/test/zlib/test_zlib.rb +++ b/test/zlib/test_zlib.rb @@ -232,6 +232,12 @@ if defined? Zlib end class TestZlibInflate < Test::Unit::TestCase + def test_class_inflate_dictionary + assert_raises(Zlib::NeedDict) do + Zlib::Inflate.inflate([0x08,0x3C,0x0,0x0,0x0,0x0].pack("c*")) + end + end + def test_initialize assert_raise(Zlib::StreamError) { Zlib::Inflate.new(-1) } -- cgit v1.2.3