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

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