Blame SOURCES/0009-curl-7.61.1-CVE-2018-16890.patch

b91d92
From 81c0e81531623251a0e78f7779c049f530abe733 Mon Sep 17 00:00:00 2001
b91d92
From: Daniel Stenberg <daniel@haxx.se>
b91d92
Date: Wed, 2 Jan 2019 20:33:08 +0100
b91d92
Subject: [PATCH] NTLM: fix size check condition for type2 received data
b91d92
b91d92
Bug: https://curl.haxx.se/docs/CVE-2018-16890.html
b91d92
Reported-by: Wenxiang Qian
b91d92
CVE-2018-16890
b91d92
b91d92
Upstream-commit: b780b30d1377adb10bbe774835f49e9b237fb9bb
b91d92
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
b91d92
---
b91d92
 lib/vauth/ntlm.c | 5 +++--
b91d92
 1 file changed, 3 insertions(+), 2 deletions(-)
b91d92
b91d92
diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c
b91d92
index cdb8d8f..b614cda 100644
b91d92
--- a/lib/vauth/ntlm.c
b91d92
+++ b/lib/vauth/ntlm.c
b91d92
@@ -182,10 +182,11 @@ static CURLcode ntlm_decode_type2_target(struct Curl_easy *data,
b91d92
     target_info_len = Curl_read16_le(&buffer[40]);
b91d92
     target_info_offset = Curl_read32_le(&buffer[44]);
b91d92
     if(target_info_len > 0) {
b91d92
-      if(((target_info_offset + target_info_len) > size) ||
b91d92
+      if((target_info_offset >= size) ||
b91d92
+         ((target_info_offset + target_info_len) > size) ||
b91d92
          (target_info_offset < 48)) {
b91d92
         infof(data, "NTLM handshake failure (bad type-2 message). "
b91d92
-                    "Target Info Offset Len is set incorrect by the peer\n");
b91d92
+              "Target Info Offset Len is set incorrect by the peer\n");
b91d92
         return CURLE_BAD_CONTENT_ENCODING;
b91d92
       }
b91d92
 
b91d92
-- 
b91d92
2.17.2
b91d92