Subject: Re: libssh2 master 164838c sftp_readdir: return error if buffer is too small

Re: libssh2 master 164838c sftp_readdir: return error if buffer is too small

From: Alexander Lamaison <swish_at_lammy.co.uk>
Date: Tue, 4 Jan 2011 13:50:06 +0000

On 4 January 2011 13:31, <libssh2_at_git.stuge.se> wrote:
> - Log -----------------------------------------------------------------
> commit 164838c7dd26aa084d00dfa178b870dcda41968f
> Author: Daniel Stenberg <daniel_at_haxx.se>
> Commit: Daniel Stenberg <daniel_at_haxx.se>
>
>    sftp_readdir: return error if buffer is too small
>
>    If asked to read data into a buffer and the buffer is too small to hold
>    the data, this function now returns an error instead of as previously
>    just copy as much as fits.

As libssh2 knows the length the buffer needs to be in each case, could
we add a separate API call that fetches this buffer size? This would
allow very careful code to avoid the buffer length problem entirely.

Alex

--
Swish - Easy SFTP for Windows Explorer (http://www.swish-sftp.org)
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-01-04