From: Willy Tarreau Date: Tue, 3 Apr 2007 18:03:18 +0000 (+0200) Subject: [BUG] initialize msg->sol before parsing first line X-Git-Tag: v1.3.8.2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9bd19853e9039257c7c15cc855646ea8bae8ca8;p=thirdparty%2Fhaproxy.git [BUG] initialize msg->sol before parsing first line 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. --- diff --git a/src/proto_http.c b/src/proto_http.c index 236e77464f..38b2db02c7 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -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,