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.
The malloc code in snn.lib is: void *malloc (size_t m_size) { /* The +2 is because there's a buffer overflow somewhere in stlport. * It is triggered by stltutorial\ex13-01.cpp */ return HeapAlloc(_default_heap, 0, m_size + 2); } https://github.com/DigitalMars/dmc/blob/master/src/HEAP32/MALLOC.C HeapAlloc() is a Windows system function, i.e. bugs in it are Windows bugs.
Fixed: https://github.com/DigitalMars/dmc/commit/1ba0e41c66d8c7a266b55e5b7b19ed9476ca7726
I've updated the dmc.zip and dm857c.zip downloads.