From 59207291fc0885aad0aa221f4bb20519e465f3a8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 3 Jan 2011 00:06:26 +0100 Subject: [PATCH] docs: clarify what happens with a too small buffer This flaw is subject to change, but I figured it might be valuable to users of existing code to know how it works. --- docs/libssh2_sftp_readdir_ex.3 | 7 ++++--- docs/libssh2_sftp_symlink_ex.3 | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/libssh2_sftp_readdir_ex.3 b/docs/libssh2_sftp_readdir_ex.3 index be35aee9..9209c76d 100644 --- a/docs/libssh2_sftp_readdir_ex.3 +++ b/docs/libssh2_sftp_readdir_ex.3 @@ -13,9 +13,6 @@ libssh2_sftp_readdir_ex(LIBSSH2_SFTP_HANDLE *handle, char *buffer, size_t buffer_maxlen, char *longentry, size_t longentry_maxlen, LIBSSH2_SFTP_ATTRIBUTES *attrs); - -#define libssh2_sftp_readdir(h, b, bl, a) \\ - libssh2_sftp_readdir_ex((h), (b), (bl), NULL, 0, (a)) .SH DESCRIPTION Reads a block of data from a LIBSSH2_SFTP_HANDLE and returns file entry information for the next entry, if any. @@ -47,6 +44,10 @@ Number of bytes actually populated into buffer (not counting the terminating zero), or negative on failure. It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se. +.SH BUG +Passing in a too small buffer when receiving data only results in libssh2 not +copying the entire data amount, and it is not possible for the application to +tell when it happens! .SH ERRORS \fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed. diff --git a/docs/libssh2_sftp_symlink_ex.3 b/docs/libssh2_sftp_symlink_ex.3 index 9081c25d..6a15e93c 100644 --- a/docs/libssh2_sftp_symlink_ex.3 +++ b/docs/libssh2_sftp_symlink_ex.3 @@ -12,9 +12,6 @@ int libssh2_sftp_symlink_ex(LIBSSH2_SFTP *sftp, const char *path, unsigned int path_len, char *target, unsigned int target_len, int link_type); -int -libssh2_sftp_realpath(LIBSSH2_SFTP *sftp, const char *path, char *target, - unsigned int target_len); .SH DESCRIPTION Create a symlink or read out symlink information from the remote side. @@ -62,6 +59,10 @@ zero) or negative on failure. It returns LIBSSH2_ERROR_EAGAIN when it would otherwise block. While LIBSSH2_ERROR_EAGAIN is a negative number, it isn't really a failure per se. +.SH BUG +Passing in a too small buffer when receiving data only results in libssh2 not +copying the entire data amount, and it is not possible for the application to +tell when it happens! .SH ERRORS \fILIBSSH2_ERROR_ALLOC\fP - An internal memory allocation call failed.