4 ms·
That would depend on the implementation. But it doesn't really matter, no one should be using atoi.
by vinkelhake 3y ago
That would depend on the implementation. But it doesn't really matter, no one should be using atoi.
- stingraycharles 3y agoYeah, iirc it was exploitable because it doesn’t do any bounds checking or something like that, right?
- Lt_Riza_Hawkeye 3y agoIt bounds checks just fine, as long as you pass it a null-terminated string. It just returns 0 on error, so there's no way to know if the string was for example, larger than would fit in an int, or even just totally invalid, or if the user actually entered 0.