← Back to team overview

maria-developers team mailing list archive

Re: Rev 3814: Client attributes


Hi, Sanja!

On Sep 19, Sergei Golubchik wrote:
> This is incorrect, it might read past the end of the buffer.
> it's too late to check the length *after* you've read the data.
> Correct code might look like
>     strncpy(buf, *ptr, 9)

This is wrong, sorry. I'll stop at the first '\0'.
Should be

   memcpy(buf, *ptr, *max_bytes_available);