aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog8
-rw-r--r--ext/zlib/zlib.c2
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e5b96b4592..e05d7a02b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
+Thu Feb 3 18:33:26 2011 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * ext/zlib/zlib.c (gzfile_reader_get_unused): use rb_str_new_shared
+ because gz->z.input is hidden string. [ruby-core:35057]
+
Thu Feb 3 16:34:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
- * enc/shift_jis.c (code_to_mbc): cast as int from the subtraction of pointers.
+ * enc/shift_jis.c (code_to_mbc): cast as int from the subtraction of
+ pointers.
* enc/utf_16le.c (utf16le_mbc_enc_len): use ptrdiff_t.
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index f119a17bf6..43448818d3 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -2471,7 +2471,7 @@ gzfile_reader_get_unused(struct gzfile *gz)
}
if (NIL_P(gz->z.input)) return Qnil;
- str = rb_str_dup(gz->z.input);
+ str = rb_str_new_shared(gz->z.input);
OBJ_TAINT(str); /* for safe */
return str;
}