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);

Regards,
Sergei


_______________________________________________
Mailing list: https://launchpad.net/~maria-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to