Backport #9485

Fix segfault at unpacking modified String

Added by Nobuyoshi Nakada over 1 year ago. Updated over 1 year ago.

[ruby-dev:47952]
Status:Closed
Priority:Normal
Assignee:Usaku NAKAMURA

Description

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


Related issues

Related to Backport21 - Backport #9478: Fix segfault at unpacking modified String Closed 02/04/2014

Associated revisions

Revision 44830
Added by Usaku NAKAMURA over 1 year ago

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

* 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

#1 Updated by Nobuyoshi Nakada over 1 year ago

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

#2 Updated by Usaku NAKAMURA over 1 year ago

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

Applied in changeset r44830.


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

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

Also available in: Atom PDF