Re:How security flaws work: the buffer overflow
by jerf on Wednesday August 26, 2015 @12:42PM
(#10124202)
The solution does involve storing a length, and this is called a Pascal string: https://en.wikipedia.org/wiki/String_%28computer_science%29#...
Many, many, many moons ago, C strings won out over Pascal strings. If the competition was somehow re-run from scratch today, with modern machines, it would be no contest: Pascal strings would win. But there was a time when every byte was precious. And not just "a bit precious", but very precious.
Re:How security flaws work: the buffer overflow
by georgerobinson on Wednesday August 26, 2015 @03:12PM
(#10125330)
Wow, that's incredible, thanks for the link!
Re:How security flaws work: the buffer overflow
by TazeTSchnitzel on Wednesday August 26, 2015 @03:32PM
(#10125449)
For this case, you can use "fat pointers" that include the size of their destination.
What about:
perhaps the compiler could trace back all the calculations performed on the dst pointer to see whether this operation is valid?