| ▲ | zozbot234 3 days ago | ||||||||||||||||
How many "mature C programs" try to recover in a usable way when malloc() returns NULL? That's a crash - a well-behaved one (no UB involved) hence not one that would be sought by most attackers other than a mere denial of service - but still a crash. | |||||||||||||||||
| ▲ | okanat 3 days ago | parent | next [-] | ||||||||||||||||
On 64-bit systems (esp Linux ones) malloc almost never returns NULL but keeps overallocating (aka overcommiting). You don't get out of memory errors / kills until you access it. | |||||||||||||||||
| |||||||||||||||||
| ▲ | 1718627440 2 days ago | parent | prev [-] | ||||||||||||||||
> when malloc() returns NULL? That's a crash - a well-behaved one (no UB involved) Wrong, dereferencing a NULL pointer is UB. | |||||||||||||||||
| |||||||||||||||||