www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11646] New: [snn] `malloc` is unstable for large allocations

https://d.puremagic.com/issues/show_bug.cgi?id=11646

           Summary: [snn] `malloc` is unstable for large allocations
           Product: D
           Version: D2
          Platform: All
        OS/Version: Windows
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P2
         Component: druntime
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2013-11-30
13:54:26 MSK ---
There are integer overflows in snn's `malloc` for large allocations:
---
import core.stdc.stdlib;

void main()
{
    assert(!malloc(-1)); // Assertion failure
    assert(!malloc(0xD5550000)); // OK
    assert(!malloc(0xD5560000)); // Access violation in RTLHeapBlock::Reclaim
}
---

Yes, it really thinks it can allocate `size_t.max` bytes.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 30 2013