Blame SOURCES/0001-libssh2-1.8.0-CVE-2019-3855.patch

12243c
From db657a96ca37d87cceff14db66645ba17024803c Mon Sep 17 00:00:00 2001
12243c
From: Kamil Dudka <kdudka@redhat.com>
12243c
Date: Tue, 19 Mar 2019 13:16:53 +0100
12243c
Subject: [PATCH] Resolves: CVE-2019-3855 - fix integer overflow in transport read
12243c
12243c
... resulting in out of bounds write
12243c
12243c
Upstream-Patch: https://libssh2.org/1.8.0-CVE/CVE-2019-3855.patch
12243c
---
12243c
 src/transport.c | 6 +++++-
12243c
 1 file changed, 5 insertions(+), 1 deletion(-)
12243c
12243c
diff --git a/src/transport.c b/src/transport.c
12243c
index 8725da0..5349284 100644
12243c
--- a/src/transport.c
12243c
+++ b/src/transport.c
12243c
@@ -434,8 +434,12 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
12243c
              * and we can extract packet and padding length from it
12243c
              */
12243c
             p->packet_length = _libssh2_ntohu32(block);
12243c
-            if (p->packet_length < 1)
12243c
+            if(p->packet_length < 1) {
12243c
                 return LIBSSH2_ERROR_DECRYPT;
12243c
+            }
12243c
+            else if(p->packet_length > LIBSSH2_PACKET_MAXPAYLOAD) {
12243c
+                return LIBSSH2_ERROR_OUT_OF_BOUNDARY;
12243c
+            }
12243c
 
12243c
             p->padding_length = block[4];
12243c
 
12243c
-- 
12243c
2.17.2
12243c