ntlm: Avoid unnecessary buffer allocation for SSPI based type-2 token
This commit is contained in:
parent
c927c92086
commit
7a91296f1d
@ -297,13 +297,8 @@ CURLcode Curl_ntlm_decode_type2_message(struct SessionHandle *data,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_WINDOWS_SSPI
|
#ifdef USE_WINDOWS_SSPI
|
||||||
ntlm->type_2 = malloc(size + 1);
|
ntlm->type_2 = buffer;
|
||||||
if(ntlm->type_2 == NULL) {
|
|
||||||
free(buffer);
|
|
||||||
return CURLE_OUT_OF_MEMORY;
|
|
||||||
}
|
|
||||||
ntlm->n_type_2 = curlx_uztoul(size);
|
ntlm->n_type_2 = curlx_uztoul(size);
|
||||||
memcpy(ntlm->type_2, buffer, size);
|
|
||||||
#else
|
#else
|
||||||
ntlm->flags = 0;
|
ntlm->flags = 0;
|
||||||
|
|
||||||
@ -336,8 +331,9 @@ CURLcode Curl_ntlm_decode_type2_message(struct SessionHandle *data,
|
|||||||
fprintf(stderr, "\n****\n");
|
fprintf(stderr, "\n****\n");
|
||||||
fprintf(stderr, "**** Header %s\n ", header);
|
fprintf(stderr, "**** Header %s\n ", header);
|
||||||
});
|
});
|
||||||
#endif
|
|
||||||
free(buffer);
|
free(buffer);
|
||||||
|
#endif
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
@ -442,7 +442,7 @@ struct ntlmdata {
|
|||||||
size_t max_token_length;
|
size_t max_token_length;
|
||||||
BYTE *output_token;
|
BYTE *output_token;
|
||||||
int has_handles;
|
int has_handles;
|
||||||
void *type_2;
|
BYTE *type_2;
|
||||||
unsigned long n_type_2;
|
unsigned long n_type_2;
|
||||||
#else
|
#else
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user