ruby-changes:18960
From: mrkn <ko1@a...>
Date: Tue, 1 Mar 2011 13:41:00 +0900 (JST)
Subject: [ruby-changes:18960] Ruby:r30993 (trunk): * ext/bigdecimal/bigdecimal.c (VpMemAlloc): CVE-2011-0188.
mrkn 2011-03-01 13:40:49 +0900 (Tue, 01 Mar 2011) New Revision: 30993 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30993 Log: * ext/bigdecimal/bigdecimal.c (VpMemAlloc): CVE-2011-0188. Fixes a bug reported by Drew Yao <ayao at apple.com> Modified files: trunk/ChangeLog trunk/ext/bigdecimal/bigdecimal.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30992) +++ ChangeLog (revision 30993) @@ -1,3 +1,8 @@ +Tue Mar 1 13:25:00 2011 Kenta Murata <mrkn@m...> + + * ext/bigdecimal/bigdecimal.c (VpMemAlloc): CVE-2011-0188. + Fixes a bug reported by Drew Yao <ayao at apple.com> + Tue Mar 1 10:34:39 2011 NARUSE, Yui <naruse@r...> * string.c (rb_str_byteslice): Add String#byteslice. [ruby-core:35376] Index: ext/bigdecimal/bigdecimal.c =================================================================== --- ext/bigdecimal/bigdecimal.c (revision 30992) +++ ext/bigdecimal/bigdecimal.c (revision 30993) @@ -2237,11 +2237,11 @@ VP_EXPORT void * VpMemAlloc(size_t mb) { - void *p = xmalloc((unsigned int)mb); - if(!p) { - VpException(VP_EXCEPTION_MEMORY,"failed to allocate memory",1); + void *p = xmalloc(mb); + if (!p) { + VpException(VP_EXCEPTION_MEMORY, "failed to allocate memory", 1); } - memset(p,0,mb); + memset(p, 0, mb); #ifdef BIGDECIMAL_DEBUG gnAlloc++; /* Count allocation call */ #endif /* BIGDECIMAL_DEBUG */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/