Index: ext/zlib/zlib.c =================================================================== --- ext/zlib/zlib.c (revision 30767) +++ ext/zlib/zlib.c (working copy) @@ -2471,7 +2471,9 @@ gzfile_reader_get_unused(struct gzfile * } if (NIL_P(gz->z.input)) return Qnil; - str = rb_str_dup(gz->z.input); + str = rb_str_new(NULL, 0); + rb_str_concat(str, gz->z.input); + //str = rb_str_dup(gz->z.input); OBJ_TAINT(str); /* for safe */ return str; }