>>106494585
Writing correct bounds checking is actually quite annoying. Especially so if you are working with binary files loaded into memory.
if((ptr + offset + length) < end)
error;
Consider the above, its wrong because of overflow. Its an absolute pain in the ass to make sure that every bounds check respects overflow. Sure you can make helper functions, but there are so many different variations that it quickly becomes a mess.