* Is every programmer responsible for detecting this condition?
* (This will make manual string manipulation very complicated and dangerous.)
* Suppose you're concatenating two strings, such that the sum of the lengths requires an additional byte. This could cause a buffer overflow. How would a strcat() function avoid causing a buffer overflow here?
* Does every string need a maximum-length counter too?
* Can you access a random element in the string without having to dereference and decode the length?
On the other hand, if you use a constant-sized length,
* What happens when you overflow the maximum length?
* Can you erroneously create a shorter string by appending text?
* How should string libraries handle this condition? By abort()ing? By returning a special error code? Does every string manipulation need to be wrapped in an if() to detect the special error? How should the programmer handle this condition?
In either case,
* Can you tokenize a string in-place?
* Can an attacker read a program's entire address space by finding an address that begins 0xffffffff and treating it as a string?