mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-26 19:47:17 +00:00
00de17fa46
Upstream-Status: Backport [https://gitlab.com/libssh/libssh-mirror/-/commit/533d881b0f4b24c72b35ecc97fa35d295d063e53 & https://gitlab.com/libssh/libssh-mirror/-/commit/2782cb0495b7450bd8fe43ce4af886b66fea6c40 & https://gitlab.com/libssh/libssh-mirror/-/commit/10b3ebbe61a7031a3dae97f05834442220447181 & https://gitlab.com/libssh/libssh-mirror/-/commit/245ad744b5ab0582fef7cf3905a717b791d7e08b] Signed-off-by: Vijay Anusuri <vanusuri@mvista.com> Signed-off-by: Armin Kuster <akuster808@gmail.com>
43 lines
1.4 KiB
Diff
43 lines
1.4 KiB
Diff
From 2782cb0495b7450bd8fe43ce4af886b66fea6c40 Mon Sep 17 00:00:00 2001
|
|
From: Andreas Schneider <asn@cryptomilk.org>
|
|
Date: Wed, 3 Jun 2020 10:05:51 +0200
|
|
Subject: [PATCH] sftpserver: Add missing return check for
|
|
ssh_buffer_add_data()
|
|
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
|
|
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
|
|
|
|
Upstream-Status: Backport [https://gitlab.com/libssh/libssh-mirror/-/commit/2782cb0495b7450bd8fe43ce4af886b66fea6c40]
|
|
CVE: CVE-2020-16135
|
|
Signed-off-by: Vijay Anusuri <vanusuri@mvista.com>
|
|
---
|
|
src/sftpserver.c | 11 ++++++++---
|
|
1 file changed, 8 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/src/sftpserver.c b/src/sftpserver.c
|
|
index b639a2ce3..9117f155f 100644
|
|
--- a/src/sftpserver.c
|
|
+++ b/src/sftpserver.c
|
|
@@ -73,9 +73,14 @@ sftp_client_message sftp_get_client_message(sftp_session sftp) {
|
|
return NULL;
|
|
}
|
|
|
|
- ssh_buffer_add_data(msg->complete_message,
|
|
- ssh_buffer_get(payload),
|
|
- ssh_buffer_get_len(payload));
|
|
+ rc = ssh_buffer_add_data(msg->complete_message,
|
|
+ ssh_buffer_get(payload),
|
|
+ ssh_buffer_get_len(payload));
|
|
+ if (rc < 0) {
|
|
+ ssh_set_error_oom(session);
|
|
+ sftp_client_message_free(msg);
|
|
+ return NULL;
|
|
+ }
|
|
|
|
ssh_buffer_get_u32(payload, &msg->id);
|
|
|
|
--
|
|
GitLab
|
|
|