summaryrefslogtreecommitdiffstats
path: root/aclk
diff options
context:
space:
mode:
authorTimotej S <6674623+underhood@users.noreply.github.com>2023-08-08 16:59:13 +0200
committerGitHub <noreply@github.com>2023-08-08 17:59:13 +0300
commit1c8e72dfea192a4ef33e9c29aa3861a495a58625 (patch)
tree29c55d15a9015391415fba48bb09543f2bd495b3 /aclk
parent8bf4cd4ef767e0c6e31a87e0c68e40e7c0ddc83b (diff)
Fix CID 398318 (#15766)
Diffstat (limited to 'aclk')
-rw-r--r--aclk/https_client.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/aclk/https_client.c b/aclk/https_client.c
index 629d2b1a41..623082027d 100644
--- a/aclk/https_client.c
+++ b/aclk/https_client.c
@@ -183,18 +183,19 @@ static int process_chunked_content(rbuf_t buf, http_parse_ctx *parse_ctx)
char buf_size[HTTP_HDR_BUFFER_SIZE];
rbuf_pop(buf, buf_size, idx);
buf_size[idx] = 0;
- parse_ctx->chunk_size = strtol(buf_size, NULL, 16);
- if (parse_ctx->chunk_size < 0 || parse_ctx->chunk_size == LONG_MAX) {
+ long chunk_size = strtol(buf_size, NULL, 16);
+ if (chunk_size < 0 || chunk_size == LONG_MAX) {
netdata_log_error("Chunk size out of range");
return PARSE_ERROR;
}
+ parse_ctx->chunk_size = chunk_size;
if (parse_ctx->chunk_size == 0) {
if (errno == EINVAL) {
netdata_log_error("Invalid chunk size");
return PARSE_ERROR;
}
parse_ctx->chunked_content_state = CHUNKED_CONTENT_CHUNK_END_CRLF;
- return 0;
+ continue;
}
parse_ctx->chunk_got = 0;
chunked_response_buffer_grow_by(parse_ctx, parse_ctx->chunk_size);