> On second thought I think you are correct. At the end of the function
> the pointer might be one byte past the buffer size, but then it won't
> do any reads or writes (But it could be a problem if the buffer is
> right at the end of the virtual memory space . Sorry about the buggy
> bug report.


The buffer can't be right at the end of the virtual memory space.

The C standard guarantees (or rather, requires) that whenever
you've got an allocated buffer, computing the pointer just past
(some would say at) the end of the buffer can be done without
address overflow, precisely because that kind of bounds check
is such a common idiom.

Russ