File curl-CVE-2018-16890.patch of Package curl.openSUSE_Leap_42.3_Update

From a54ba07a3a01f21de64ecabaafcc01b40b9db5a4 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Wed, 2 Jan 2019 20:33:08 +0100
Subject: [PATCH 1/3] NTLM: fix size check condition for type2 received data

Reported-by: Wenxiang Qian
---
 lib/curl_ntlm_msgs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Index: curl-7.37.0/lib/curl_ntlm_msgs.c
===================================================================
--- curl-7.37.0.orig/lib/curl_ntlm_msgs.c
+++ curl-7.37.0/lib/curl_ntlm_msgs.c
@@ -199,10 +199,11 @@ CURLcode Curl_ntlm_decode_type2_target(s
     target_info_len = readshort_le(&buffer[40]);
     target_info_offset = readint_le(&buffer[44]);
     if(target_info_len > 0) {
-      if(((target_info_offset + target_info_len) > size) ||
+      if((target_info_offset >= size) ||
+         ((target_info_offset + target_info_len) > size) ||
          (target_info_offset < 48)) {
         infof(data, "NTLM handshake failure (bad type-2 message). "
-                    "Target Info Offset Len is set incorrect by the peer\n");
+              "Target Info Offset Len is set incorrect by the peer\n");
         return CURLE_REMOTE_ACCESS_DENIED;
       }
 
openSUSE Build Service is sponsored by