[ruby-dev:47959] [Backport93 - Backport #9485] [Closed] Fix segfault at unpacking modified String

From: usa@...
Date: 2014-02-05 04:43:58 UTC
List: ruby-dev #47959
Issue #9485 has been updated by Usaku NAKAMURA.

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.

----------------------------------------
Backport #9485: Fix segfault at unpacking modified String
https://bugs.ruby-lang.org/issues/9485#change-44968

* Author: Nobuyoshi Nakada
* Status: Closed
* Priority: Normal
* Assignee: Usaku NAKAMURA
* Category: 
* Target version: 
* ruby -v: 1.9.3p511
----------------------------------------
trunkではr44803で修正済みですが、1.9.3以降2.1まで `([""].pack("p")<<"a").unpack("p")` でSEGVします。
1.9.2までは起きないようです。



-- 
http://bugs.ruby-lang.org/

In This Thread

Prev Next