|
|
|
|
|
by lelanthran
161 days ago
|
|
> Every string function is designed to keep going until it finds the NULL character, so if a hacker gets rid of the NULL character, What sort of situation are you envisioning where a hacker can remove the sentinel (in the case of nul-termination) but not modify the length bytes (in the case of fat pointers)? |
|
By contrast it's pretty unlikely for buggy code to mess the length. Add an element? +1. Remove an element? -1. Number of elements larger than capacity? Allocate a new array. Not much room for error.