Re:Pitfalls in C and C++: Unsigned Types (2011)
by dllthomas on Wednesday September 25, 2013 @02:55PM
(#6446529)
Not so. buf[-1] will step on mapped memory that is probably something else important, and you won't find out about it until later, which is hard to debug and more likely disastrous (if there's room for disaster in the use of the software). buf[4294967295] will try to use memory that is almost certainly unmapped and unavailable, and will segfault immediately - right on the line that caused the problem - and won't take any potentially disastrous actions.
[ Parent
| on HN ]
There are no comments on this comment yet.