[前][次][番号順一覧][スレッド一覧]

ruby-changes:35531

From: normal <ko1@a...>
Date: Wed, 17 Sep 2014 16:26:30 +0900 (JST)
Subject: [ruby-changes:35531] normal:r47613 (trunk): ext/zlib/zlib.c (zlib_mem_alloc): check overflow

normal	2014-09-17 16:26:12 +0900 (Wed, 17 Sep 2014)

  New Revision: 47613

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=47613

  Log:
    ext/zlib/zlib.c (zlib_mem_alloc): check overflow

  Modified files:
    trunk/ChangeLog
    trunk/ext/zlib/zlib.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 47612)
+++ ChangeLog	(revision 47613)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Sep 17 16:22:58 2014  Eric Wong  <e@8...>
+
+	* ext/zlib/zlib.c (zlib_mem_alloc): check overflow
+
 Wed Sep 17 11:33:35 2014  Laurent Arnoud  <laurent@s...>
 
 	* test/fiddle/test_import.rb (Fiddle::TestImport#test_sizeof):
Index: ext/zlib/zlib.c
===================================================================
--- ext/zlib/zlib.c	(revision 47612)
+++ ext/zlib/zlib.c	(revision 47613)
@@ -584,7 +584,7 @@ struct zstream_run_args { https://github.com/ruby/ruby/blob/trunk/ext/zlib/zlib.c#L584
 static voidpf
 zlib_mem_alloc(voidpf opaque, uInt items, uInt size)
 {
-    voidpf p = xmalloc(items * size);
+    voidpf p = xmalloc2(items, size);
     /* zlib FAQ: Valgrind (or some similar memory access checker) says that
        deflate is performing a conditional jump that depends on an
        uninitialized value.  Isn't that a bug?

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]