3 ms·
> If your code doesn't have bugs, no validation of indexes is required. Your code doesn't have bugs because you validated your indexes. What you said makes som
by cesarb 5y ago
> If your code doesn't have bugs, no validation of indexes is required.
Your code doesn't have bugs because you validated your indexes. What you said makes some sense when the index comes from within the program itself, but not when it comes from outside the program. Consider for instance the case of reading a data structure from a file or the network, where one field is an index or an offset into another part of the structure; you must validate that this index or offset is not outside the bounds, no matter how perfect your code is.