Project

General

Profile

Backport #9478

Fix segfault at unpacking modified String

Added by nobu (Nobuyoshi Nakada) over 5 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
[ruby-dev:47947]

Description

1.9以降でr44803で追加したテストがSEGVします。


Related issues

Related to Backport200 - Backport #9484: Fix segfault at unpacking modified StringClosed02/05/2014Actions
Related to Backport193 - Backport #9485: Fix segfault at unpacking modified StringClosed02/05/2014Actions

Associated revisions

Revision 673745f7
Added by naruse (Yui NARUSE) over 5 years ago

merge revision(s) 44803: [Backport #9478]

    * string.c (rb_str_modify_expand): enable capacity and disable
      assocation with packed objects when setting capa, so that
      pack("p") string fails to unpack properly after modified.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@44819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 44819
Added by naruse (Yui NARUSE) over 5 years ago

merge revision(s) 44803: [Backport #9478]

* string.c (rb_str_modify_expand): enable capacity and disable
  assocation with packed objects when setting capa, so that
  pack("p") string fails to unpack properly after modified.

History

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport21

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Assignee set to naruse (Yui NARUSE)

trunkではr44803で修正済みですが、1.9.3以降2.1まで ([""].pack("p")<<"a").unpack("p") でSEGVします。
1.9.2までは起きないようです。

Updated by naruse (Yui NARUSE) over 5 years ago

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

Applied in changeset r44819.


merge revision(s) 44803: [Backport #9478]

* string.c (rb_str_modify_expand): enable capacity and disable
  assocation with packed objects when setting capa, so that
  pack("p") string fails to unpack properly after modified.

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Related to Backport #9484: Fix segfault at unpacking modified String added

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Related to Backport #9485: Fix segfault at unpacking modified String added

Also available in: Atom PDF