mirror of https://github.com/openssl/openssl.git
return 0 if an error occurred
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22504)
(cherry picked from commit f0d88b4d07)
This commit is contained in:
parent
df226ab548
commit
e63c1a1eab
|
|
@ -495,13 +495,17 @@ static int parse_http_line1(char *line, int *found_keep_alive)
|
||||||
|
|
||||||
static int check_set_resp_len(OSSL_HTTP_REQ_CTX *rctx, size_t len)
|
static int check_set_resp_len(OSSL_HTTP_REQ_CTX *rctx, size_t len)
|
||||||
{
|
{
|
||||||
if (rctx->max_resp_len != 0 && len > rctx->max_resp_len)
|
if (rctx->max_resp_len != 0 && len > rctx->max_resp_len) {
|
||||||
ERR_raise_data(ERR_LIB_HTTP, HTTP_R_MAX_RESP_LEN_EXCEEDED,
|
ERR_raise_data(ERR_LIB_HTTP, HTTP_R_MAX_RESP_LEN_EXCEEDED,
|
||||||
"length=%zu, max=%zu", len, rctx->max_resp_len);
|
"length=%zu, max=%zu", len, rctx->max_resp_len);
|
||||||
if (rctx->resp_len != 0 && rctx->resp_len != len)
|
return 0;
|
||||||
|
}
|
||||||
|
if (rctx->resp_len != 0 && rctx->resp_len != len) {
|
||||||
ERR_raise_data(ERR_LIB_HTTP, HTTP_R_INCONSISTENT_CONTENT_LENGTH,
|
ERR_raise_data(ERR_LIB_HTTP, HTTP_R_INCONSISTENT_CONTENT_LENGTH,
|
||||||
"ASN.1 length=%zu, Content-Length=%zu",
|
"ASN.1 length=%zu, Content-Length=%zu",
|
||||||
len, rctx->resp_len);
|
len, rctx->resp_len);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
rctx->resp_len = len;
|
rctx->resp_len = len;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue