Backport #8829

Segfault in Zlib::Inflate

Added by McClain Looney 8 months ago. Updated 8 months ago.

[ruby-core:56848]
Status:Closed
Priority:Normal
Assignee:Tomoyuki Chikanaga

Description

Repro:

ruby -rzlib -e 'Zlib::Inflate.inflate([0x08,0x3C,0x0,0x0,0x0,0x0].pack("c*"))'

tested on p247, osx (10.8), linux 2.6, (linux: zlib 1.2.3)

segfault (2.3 KB) McClain Looney, 08/29/2013 12:06 AM

Associated revisions

Revision 42727
Added by Tomoyuki Chikanaga 8 months ago

merge revision(s) 42720: [Backport #8829]

* 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.

History

#1 Updated by Eric Hodel 8 months ago

  • Status changed from Open to Assigned
  • Assignee set to Eric Hodel
  • Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: REQUIRED

Seems to be my bug.

#2 Updated by Eric Hodel 8 months ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r42720.
McClain, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • 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.

#3 Updated by Tomoyuki Chikanaga 8 months ago

  • Tracker changed from Bug to Backport
  • Project changed from ruby-trunk to Backport200
  • Category deleted (core)
  • Status changed from Closed to Assigned
  • Assignee changed from Eric Hodel to Tomoyuki Chikanaga

#4 Updated by Tomoyuki Chikanaga 8 months ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r42727.
McClain, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 42720: [Backport #8829]

* 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.

Also available in: Atom PDF