From d62a7e712ade6b31fe0917180d356219d5488fa0 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 18 Dec 2004 07:37:01 +0000 Subject: * ext/zlib/zlib.c (rb_deflate_s_deflate, rb_inflate_s_inflate): disallow interrupt by type conversion. fixed: [ruby-dev:25226] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++-- ext/zlib/zlib.c | 9 +++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 35ae55199e..5e5fc35547 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sat Dec 18 16:36:23 2004 Nobuyoshi Nakada + + * ext/zlib/zlib.c (rb_deflate_s_deflate, rb_inflate_s_inflate): + disallow interrupt by type conversion. fixed: [ruby-dev:25226] + Sat Dec 18 15:16:41 2004 NAKAMURA, Hiroshi * lib/webrick/httpauth.rb, @@ -52,7 +57,7 @@ Fri Dec 17 16:28:12 2004 Hidetoshi NAGAI Fri Dec 17 13:50:00 2004 Akiyoshi, Masamichi (akiyoshi@hp.com) - * vms/vmsruby_private.c, vms/vmsruby_private.h: private routines + * vms/vmsruby_private.c, vms/vmsruby_private.h: private routines for VMS port are added. * eval.c (ruby_init): change to call VMS private intialization routine. @@ -1285,7 +1290,7 @@ Thu Oct 21 21:32:30 2004 IWATSUKI Hiroyuki * lib/pstore.rb (PStore#transaction): Use the empty content when a file is not found. [ruby-dev:24561] - + Thu Oct 21 19:06:15 2004 GOTOU Yuuzou * lib/webrick/httpresponse.rb (WEBrick::HTTPResponse#send_body_io): diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 6dfb4cb4b6..1a664fd400 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -1202,18 +1202,19 @@ rb_deflate_s_deflate(argc, argv, klass) { struct zstream z; VALUE src, level, dst; - int err; + int err, lev; rb_scan_args(argc, argv, "11", &src, &level); + lev = ARG_LEVEL(level); + StringValue(src); zstream_init_deflate(&z); - err = deflateInit(&z.stream, ARG_LEVEL(level)); + err = deflateInit(&z.stream, lev); if (err != Z_OK) { raise_zlib_error(err, z.stream.msg); } ZSTREAM_READY(&z); - StringValue(src); zstream_run(&z, RSTRING(src)->ptr, RSTRING(src)->len, Z_FINISH); dst = zstream_detach_buffer(&z); zstream_end(&z); @@ -1454,6 +1455,7 @@ rb_inflate_s_inflate(obj, src) VALUE dst; int err; + StringValue(src); zstream_init_inflate(&z); err = inflateInit(&z.stream); if (err != Z_OK) { @@ -1461,7 +1463,6 @@ rb_inflate_s_inflate(obj, src) } ZSTREAM_READY(&z); - StringValue(src); zstream_run(&z, RSTRING(src)->ptr, RSTRING(src)->len, Z_SYNC_FLUSH); zstream_run(&z, "", 0, Z_FINISH); /* for checking errors */ dst = zstream_detach_buffer(&z); -- cgit v1.2.3