Next: , Previous: File functions, Up: Top


10 Automatic strings

Almost all programs need to use strings at some point, if only for handling user input and output. Now, although the ANSI library provides a wide variety of string functions, all these functions assume that the programmer is allocating memory explicitly, and will never do anything which could cause an overrun in a string buffer. Well, to be honest, that isn't the case – and this is one of the prime causes of buffer-overflow bug exploits for setuid programs. So Libretto provides a transparently re-allocating string type, together with the functions to manipulate it.