]>
Commit | Line | Data |
---|---|---|
73237241 MT |
1 | ------------------------------------------------------------ |
2 | revno: 10486 | |
3 | revision-id: squid3@treenet.co.nz-20130222111325-zizr296kq3te4g7h | |
4 | parent: squid3@treenet.co.nz-20130109021503-hqg7ufldrudpzr9l | |
5 | fixes bug(s): http://bugs.squid-cache.org/show_bug.cgi?id=3790 | |
6 | author: Reinhard Sojka <reinhard.sojka@parlament.gv.at> | |
7 | committer: Amos Jeffries <squid3@treenet.co.nz> | |
8 | branch nick: SQUID_3_1 | |
9 | timestamp: Fri 2013-02-22 04:13:25 -0700 | |
10 | message: | |
11 | Bug 3790: cachemgr.cgi crash with authentication | |
12 | ------------------------------------------------------------ | |
13 | # Bazaar merge directive format 2 (Bazaar 0.90) | |
14 | # revision_id: squid3@treenet.co.nz-20130222111325-zizr296kq3te4g7h | |
15 | # target_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ | |
16 | # /SQUID_3_1 | |
17 | # testament_sha1: 121adf68a9c3b2eca766cfb768256b6b57d9816b | |
18 | # timestamp: 2013-02-22 11:17:18 +0000 | |
19 | # source_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ | |
20 | # /SQUID_3_1 | |
21 | # base_revision_id: squid3@treenet.co.nz-20130109021503-\ | |
22 | # hqg7ufldrudpzr9l | |
23 | # | |
24 | # Begin patch | |
25 | === modified file 'tools/cachemgr.cc' | |
26 | --- tools/cachemgr.cc 2013-01-08 23:11:51 +0000 | |
27 | +++ tools/cachemgr.cc 2013-02-22 11:13:25 +0000 | |
28 | @@ -1162,7 +1162,6 @@ | |
29 | { | |
30 | static char buf[1024]; | |
31 | size_t stringLength = 0; | |
32 | - const char *str64; | |
33 | ||
34 | if (!req->passwd) | |
35 | return ""; | |
36 | @@ -1171,15 +1170,12 @@ | |
37 | req->user_name ? req->user_name : "", | |
38 | req->passwd); | |
39 | ||
40 | - str64 = base64_encode(buf); | |
41 | - | |
42 | - stringLength += snprintf(buf, sizeof(buf), "Authorization: Basic %s\r\n", str64); | |
43 | + stringLength += snprintf(buf, sizeof(buf), "Authorization: Basic %s\r\n", base64_encode(buf)); | |
44 | ||
45 | assert(stringLength < sizeof(buf)); | |
46 | ||
47 | - snprintf(&buf[stringLength], sizeof(buf) - stringLength, "Proxy-Authorization: Basic %s\r\n", str64); | |
48 | + snprintf(&buf[stringLength], sizeof(buf) - stringLength, "Proxy-Authorization: Basic %s\r\n", base64_encode(buf)); | |
49 | ||
50 | - xxfree(str64); | |
51 | return buf; | |
52 | } | |
53 | ||
54 |