Files
poky/meta/recipes-support/libssh2/libssh2/CVE-2020-22218.patch
Chee Yang Lee 91ea1ab7c6 libssh2: fix CVE-2020-22218
(From OE-Core rev: a0b41511766130883e93b5b8a07801a836beeb67)

Signed-off-by: Chee Yang Lee <chee.yang.lee@intel.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
2023-09-08 16:09:41 -10:00

35 lines
1.1 KiB
Diff

CVE: CVE-2020-22218
Upstream-Status: Backport [ https://github.com/libssh2/libssh2/commit/642eec48ff3adfdb7a9e562b6d7fc865d1733f45 ]
Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
From 642eec48ff3adfdb7a9e562b6d7fc865d1733f45 Mon Sep 17 00:00:00 2001
From: lutianxiong <lutianxiong@huawei.com>
Date: Fri, 29 May 2020 01:25:40 +0800
Subject: [PATCH] transport.c: fix use-of-uninitialized-value (#476)
file:transport.c
notes:
return error if malloc(0)
credit:
lutianxiong
---
src/transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/transport.c b/src/transport.c
index 96fca6b8cc..adf96c2437 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -472,7 +472,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
/* Get a packet handle put data into. We get one to
hold all data, including padding and MAC. */
p->payload = LIBSSH2_ALLOC(session, total_num);
- if(!p->payload) {
+ if(total_num == 0 || !p->payload) {
return LIBSSH2_ERROR_ALLOC;
}
p->total_num = total_num;