Avoiding Buffer Overflows and Related Problems