[macruby-changes] [4405] MacRuby/trunk/ext/zlib/zlib.c

source_changes at macosforge.org source_changes at macosforge.org
Wed Aug 4 13:53:10 PDT 2010


Revision: 4405
          http://trac.macosforge.org/projects/ruby/changeset/4405
Author:   lsansonetti at apple.com
Date:     2010-08-04 13:53:09 -0700 (Wed, 04 Aug 2010)
Log Message:
-----------
fixed a crasher in Zlib::Deflate.deflate (apparently introduced since r2347...)

Revision Links:
--------------
    http://trac.macosforge.org/projects/ruby/changeset/2347

Modified Paths:
--------------
    MacRuby/trunk/ext/zlib/zlib.c

Modified: MacRuby/trunk/ext/zlib/zlib.c
===================================================================
--- MacRuby/trunk/ext/zlib/zlib.c	2010-08-04 08:31:33 UTC (rev 4404)
+++ MacRuby/trunk/ext/zlib/zlib.c	2010-08-04 20:53:09 UTC (rev 4405)
@@ -1103,12 +1103,14 @@
 static VALUE
 rb_deflate_s_deflate(VALUE klass, SEL sel, int argc, VALUE *argv)
 {
-    struct zstream *z = (struct zstream*)zstream_deflate_new(klass);
+    struct zstream *z;
     VALUE src, level, dst, args[2];
     int err, lev;
 
     rb_scan_args(argc, argv, "11", &src, &level);
 
+    z = (struct zstream *)xmalloc(sizeof(struct zstream));
+
     lev = ARG_LEVEL(level);
     StringValue(src);
     src = rb_str_bstr(src);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100804/d0be9945/attachment.html>


More information about the macruby-changes mailing list