logoalt Hacker News

Panzerschrek • today at 4:20 AM • 1 reply • view on HN

That's why it's recommended to use size_t for passing sizes of buffers. It's unlikely to get overflow with it. In this particular case input buffer needs to have size larger than half of address space in order to trigger overflow, which isn't possible (64-bit systems usually have only 48 bits of actual address space, 32-bit systems don't allow allocating so large blocks).


Replies

m00dy • today at 4:22 AM

never say never :)