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
--- 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);
}