]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] initialize msg->sol before parsing first line
authorWilly Tarreau <w@1wt.eu>
Tue, 3 Apr 2007 18:03:18 +0000 (20:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 3 Apr 2007 18:03:18 +0000 (20:03 +0200)
Before calling http_parse_{sts,req}line(), it is necessary
to make msg->sol point to the beginning of the line. This
was not done, resulting in the proxy sometimes crashing when
URI rewriting or result rewriting was used.

src/proto_http.c

index 236e77464fd80bb92c229d482c889e299fadcba2..38b2db02c74e71adcbf4b6e810508a6a58778459 100644 (file)
@@ -3998,6 +3998,7 @@ int apply_filter_to_req_line(struct session *t, struct buffer *req, struct hdr_e
                        txn->req.eoh += delta;
                        cur_end += delta;
 
+                       txn->req.sol = req->data + txn->req.som;
                        cur_end = (char *)http_parse_reqline(&txn->req, req->data,
                                                             HTTP_MSG_RQMETH,
                                                             cur_ptr, cur_end + 1,
@@ -4563,6 +4564,7 @@ int apply_filter_to_sts_line(struct session *t, struct buffer *rtr, struct hdr_e
                        txn->rsp.eoh += delta;
                        cur_end += delta;
 
+                       txn->rsp.sol = rtr->data + txn->rsp.som;
                        cur_end = (char *)http_parse_stsline(&txn->rsp, rtr->data,
                                                             HTTP_MSG_RPVER,
                                                             cur_ptr, cur_end + 1,