]> git.pld-linux.org Git - packages/squid.git/blame - squid-2.5.STABLE7-post.patch
- fix memory leak in the processing of malformed DNS responses
[packages/squid.git] / squid-2.5.STABLE7-post.patch
CommitLineData
edbd4964
JB
1Index: squid/src/client_side.c
2diff -c squid/src/client_side.c:1.561.2.69 squid/src/client_side.c:1.561.2.70
3*** squid/src/client_side.c:1.561.2.69 Fri Jan 21 04:53:42 2005
4--- squid/src/client_side.c Thu Feb 3 17:10:09 2005
5***************
6*** 933,941 ****
7 authenticateAuthUserRequestUnlock(connState->auth_user_request);
8 connState->auth_user_request = NULL;
9 authenticateOnCloseConnection(connState);
10! if (connState->in.size == CLIENT_REQ_BUF_SZ)
11 memFree(connState->in.buf, MEM_CLIENT_REQ_BUF);
12! else
13 safe_free(connState->in.buf);
14 /* XXX account connState->in.buf */
15 pconnHistCount(0, connState->nrequests);
16--- 933,942 ----
17 authenticateAuthUserRequestUnlock(connState->auth_user_request);
18 connState->auth_user_request = NULL;
19 authenticateOnCloseConnection(connState);
20! if (connState->in.size == CLIENT_REQ_BUF_SZ) {
21 memFree(connState->in.buf, MEM_CLIENT_REQ_BUF);
22! connState->in.buf = NULL;
23! } else
24 safe_free(connState->in.buf);
25 /* XXX account connState->in.buf */
26 pconnHistCount(0, connState->nrequests);
27***************
28*** 3003,3011 ****
29 }
30 /* Continue to process previously read data */
31 }
32 /* Process request body if any */
33! if (conn->in.offset > 0 && conn->body.callback != NULL)
34 clientProcessBody(conn);
35 /* Process next request */
36 while (conn->in.offset > 0 && conn->body.size_left == 0) {
37 int nrequests;
38--- 3004,3018 ----
39 }
40 /* Continue to process previously read data */
41 }
42+ cbdataLock(conn); /* clientProcessBody might pull the connection under our feets */
43 /* Process request body if any */
44! if (conn->in.offset > 0 && conn->body.callback != NULL) {
45 clientProcessBody(conn);
46+ if (!cbdataValid(conn)) {
47+ cbdataUnlock(conn);
48+ return;
49+ }
50+ }
51 /* Process next request */
52 while (conn->in.offset > 0 && conn->body.size_left == 0) {
53 int nrequests;
54***************
55*** 3175,3181 ****
56 break;
57 } else {
58 clientAccessCheck(http);
59- continue; /* while offset > 0 && body.size_left == 0 */
60 }
61 } else if (parser_return_code == 0) {
62 /*
63--- 3182,3187 ----
64***************
65*** 3195,3205 ****
66 *H = http;
67 http->entry = clientCreateStoreEntry(http, METHOD_NONE, null_request_flags);
68 errorAppendEntry(http->entry, err);
69- return;
70 }
71 break;
72 }
73 } /* while offset > 0 && conn->body.size_left == 0 */
74 /* Check if a half-closed connection was aborted in the middle */
75 if (F->flags.socket_eof) {
76 if (conn->in.offset != conn->body.size_left) { /* != 0 when no request body */
77--- 3201,3215 ----
78 *H = http;
79 http->entry = clientCreateStoreEntry(http, METHOD_NONE, null_request_flags);
80 errorAppendEntry(http->entry, err);
81 }
82 break;
83 }
84+ if (!cbdataValid(conn)) {
85+ cbdataUnlock(conn);
86+ return;
87+ }
88 } /* while offset > 0 && conn->body.size_left == 0 */
89+ cbdataUnlock(conn);
90 /* Check if a half-closed connection was aborted in the middle */
91 if (F->flags.socket_eof) {
92 if (conn->in.offset != conn->body.size_left) { /* != 0 when no request body */
This page took 0.097993 seconds and 4 git commands to generate.