Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

malloc takes a size_t, which is unsigned. A "negative" argument is just something that's absurdly large.


On 64 bit systems it would result in a call to malloc asking for between 9.2 and 18.4 Exabytes.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: