-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Description
In our unittests, there are two tests that abuse a normal HTTP server as a proxy, just to verify that the correct headers are sent. Both use the same "proxy"; the first teset does not use any proxy authentication, the second attempts to use NTLM. As a result, the second test always segfaults at the following location:
│3395 /* Same for Proxy NTLM authentication */
│3396 if(wantProxyNTLMhttp) {
>│3397 if(!strequal(needle->proxyuser, check->proxyuser) ||
│3398 !strequal(needle->proxypasswd, check->proxypasswd))
│3399 continue;
│3400 }
because in *check, both proxyuser = 0x0 and proxypasswd = 0x0. The following patch would prevent the segfault:
diff --git a/lib/url.c b/lib/url.c
index d165d9c..ea79292 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3394,7 +3394,8 @@ ConnectionExists(struct SessionHandle *data,
/* Same for Proxy NTLM authentication */
if(wantProxyNTLMhttp) {
- if(!strequal(needle->proxyuser, check->proxyuser) ||
+ if((check->proxyuser == NULL) || (check->proxypasswd == NULL) ||
+ !strequal(needle->proxyuser, check->proxyuser) ||
!strequal(needle->proxypasswd, check->proxypasswd))
continue;
}curl/libcurl version
curl-7.48.0 and earlier.
operating system
Ubuntu 15.10, OpenSuSE 13.1
Reactions are currently unavailable