Re:Ask HN: Most regrettable design decision in computer indu...
by pilom on Tuesday September 24, 2013 @12:53PM
(#6439060)
There are 2 ways to handle strings:
1. All strings are prepended with a length variable
2. Use a NULL character to represent the end of the string
The Unix guys originally chose option 2. To them it made sense because it used fewer extra bits and it allowed you to do strings of any arbitrary length. Unfortunately, every single buffer overflow bug is because of that decision.
The Unix guys originally chose option 2. To them it made sense because it used fewer extra bits and it allowed you to do strings of any arbitrary length. Unfortunately, every single buffer overflow bug is because of that decision.