diff --git a/src/backend.c b/src/backend.c index 6a2670a67..8ce981ce0 100644 --- a/src/backend.c +++ b/src/backend.c @@ -248,8 +248,8 @@ struct server *get_server_ph_post(struct session *s) const char *params = req->data + msg->sov; const char *p = params; - if (len > req->l - msg->sov) - len = req->l - msg->sov; + if (len > req->l - (msg->sov - msg->som)) + len = req->l - (msg->sov - msg->som); if (len == 0) return NULL; diff --git a/src/proto_http.c b/src/proto_http.c index 3a93360d7..bcb02129e 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -2970,7 +2970,7 @@ int http_process_request_body(struct session *s, struct buffer *req, int an_bit) if (msg->hdr_content_len < limit) limit = msg->hdr_content_len; - if (req->l - msg->sov >= limit) /* we have enough bytes now */ + if (req->l - (msg->sov - msg->som) >= limit) /* we have enough bytes now */ goto http_end; missing_data: