!29 开源软件包 libssh2 社区补丁回合
From: @zjay998 Reviewed-by: @seuzw Signed-off-by: @seuzw
This commit is contained in:
commit
15873ea1f5
@ -1,6 +1,6 @@
|
||||
Name: libssh2
|
||||
Version: 1.10.0
|
||||
Release: 3
|
||||
Release: 4
|
||||
Summary: A library implementing the SSH2 protocol
|
||||
License: BSD
|
||||
URL: https://www.libssh2.org/
|
||||
@ -8,6 +8,7 @@ Source0: https://libssh2.org/download/libssh2-%{version}.tar.gz
|
||||
|
||||
Patch0: backport-RSA-SHA2-256-512-key-upgrade-support-RFC-8332.patch
|
||||
Patch1: backport-misc-libssh2_copy_string-avoid-malloc-zero-bytes.patch
|
||||
Patch2: sftp-Prevent-files-from-being-skipped-if-the-output.patch
|
||||
|
||||
BuildRequires: coreutils findutils /usr/bin/man zlib-devel
|
||||
BuildRequires: gcc make sed openssl-devel > 1:1.0.1 openssh-server
|
||||
@ -87,6 +88,12 @@ LC_ALL=en_US.UTF-8 make -C tests check
|
||||
%{_mandir}/man3/libssh2_*.3*
|
||||
|
||||
%changelog
|
||||
* Mon Oct 17 2022 zhangjun <zhangjun@kylinos.cn> - 1.10.0-4
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:Prevent files from being skipped if the output buffer is too small
|
||||
|
||||
* Thu Sep 29 2022 zhangjun <zhangjun@kylinos.cn> - 1.10.0-3
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
|
||||
43
sftp-Prevent-files-from-being-skipped-if-the-output.patch
Normal file
43
sftp-Prevent-files-from-being-skipped-if-the-output.patch
Normal file
@ -0,0 +1,43 @@
|
||||
From bd9c65d68c4152ba0726f5588b4b611410972fbc Mon Sep 17 00:00:00 2001
|
||||
From: Gabriel Smith <ga29smith@gmail.com>
|
||||
Date: Fri, 23 Sep 2022 13:03:56 -0400
|
||||
Subject: [PATCH] sftp: Prevent files from being skipped if the output buffer
|
||||
is too small (#746)
|
||||
|
||||
Notes:
|
||||
LIBSSH2_ERROR_BUFFER_TOO_SMALL is returned if the buffer is too small
|
||||
to contain a returned directory entry. On this condition we jump to the
|
||||
label `end`. At this point the number of names left is decremented
|
||||
despite no name being returned.
|
||||
|
||||
As suggested in #714, this commit moves the error label after the
|
||||
decrement of `names_left`.
|
||||
|
||||
Fixes #714
|
||||
|
||||
Credit:
|
||||
Co-authored-by: Gabriel Smith <gabriel.smith@precisionot.com>
|
||||
---
|
||||
src/sftp.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/sftp.c b/src/sftp.c
|
||||
index b1a5352..2df918a 100644
|
||||
--- a/src/sftp.c
|
||||
+++ b/src/sftp.c
|
||||
@@ -1852,11 +1852,11 @@ static ssize_t sftp_readdir(LIBSSH2_SFTP_HANDLE *handle, char *buffer,
|
||||
|
||||
handle->u.dir.next_name = (char *) s;
|
||||
handle->u.dir.names_packet_len = names_packet_len;
|
||||
- end:
|
||||
|
||||
if((--handle->u.dir.names_left) == 0)
|
||||
LIBSSH2_FREE(session, handle->u.dir.names_packet);
|
||||
|
||||
+ end:
|
||||
_libssh2_debug(session, LIBSSH2_TRACE_SFTP,
|
||||
"libssh2_sftp_readdir_ex() return %d",
|
||||
filename_len);
|
||||
--
|
||||
2.25.1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user