[TUHS] buffer overflow (Re: Happy birthday Morris worm

Arthur Krewat krewat at kilonet.net
Wed Nov 13 08:49:46 AEST 2019

On 11/12/2019 5:41 PM, Robert Clausecker wrote:
> Oh please no.  One of the things we've hopefully all learned from Pascal
> is that length-prefixed strings suck because you can't perform anything
> useful without copying the entire string.  Rob Pike and friends showed
> how to get strings and vectors right in the Go language where you have a
> builtin slice type which is essentially a structure
>      struct slice(type) {
>              type *data;
>              size_t len, cap;
>      };

And none of that stops some programmer from doing slice.cap=255 - or is 
it read-only? ;)

More information about the TUHS mailing list