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

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