[3788] MacRuby/trunk/ext/bigdecimal/bigdecimal.c
Revision: 3788 http://trac.macosforge.org/projects/ruby/changeset/3788 Author: martinlagardette@apple.com Date: 2010-03-17 18:05:03 -0700 (Wed, 17 Mar 2010) Log Message: ----------- Avoid integer truncation in BigDecimal In a 64-bit program, if mb is > 2^32, the amount to allocate will be truncated to a 32-bit unsigned integer, but then the amount to memset will use the full 64-bit number." - Fixes 7697476 Modified Paths: -------------- MacRuby/trunk/ext/bigdecimal/bigdecimal.c Modified: MacRuby/trunk/ext/bigdecimal/bigdecimal.c =================================================================== --- MacRuby/trunk/ext/bigdecimal/bigdecimal.c 2010-03-17 21:35:16 UTC (rev 3787) +++ MacRuby/trunk/ext/bigdecimal/bigdecimal.c 2010-03-18 01:05:03 UTC (rev 3788) @@ -2020,7 +2020,7 @@ VP_EXPORT void * VpMemAlloc(U_LONG mb) { - void *p = xmalloc((unsigned int)mb); + void *p = xmalloc(mb); if(!p) { VpException(VP_EXCEPTION_MEMORY,"failed to allocate memory",1); }
participants (1)
-
source_changes@macosforge.org