blob: dcb483915fb0a98c61c02d44931c5118c480e15e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
$NetBSD: patch-aa,v 1.8 2005/02/25 00:47:30 salo Exp $
--- lib/http_ntlm.c.orig 2004-12-08 00:09:41.000000000 +0100
+++ lib/http_ntlm.c 2005-02-25 01:09:30.000000000 +0100
@@ -103,7 +103,6 @@
header++;
if(checkprefix("NTLM", header)) {
- unsigned char buffer[256];
header += strlen("NTLM");
while(*header && isspace((int)*header))
@@ -123,8 +122,12 @@
(40) Target Information (optional) security buffer(*)
32 (48) start of data block
*/
+ size_t size;
+ unsigned char *buffer = (unsigned char *)malloc(strlen(header));
+ if (buffer == NULL)
+ return CURLNTLM_BAD;
- size_t size = Curl_base64_decode(header, (char *)buffer);
+ size = Curl_base64_decode(header, (char *)buffer);
ntlm->state = NTLMSTATE_TYPE2; /* we got a type-2 */
@@ -134,6 +137,7 @@
/* at index decimal 20, there's a 32bit NTLM flag field */
+ free(buffer);
}
else {
if(ntlm->state >= NTLMSTATE_TYPE1)
|