From b3d6d23861db6fbe5f97a797a08e589f7cf7b1ea Mon Sep 17 00:00:00 2001 From: Leonardo Alminana Date: Thu, 5 Sep 2024 16:06:13 +0200 Subject: [PATCH] Revert "in_elasticsearch: improved buffer size check" This reverts commit bf836312041fbcb171b6ba79f5f193d22f150c08. --- plugins/in_elasticsearch/in_elasticsearch_bulk_conn.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/in_elasticsearch/in_elasticsearch_bulk_conn.c b/plugins/in_elasticsearch/in_elasticsearch_bulk_conn.c index cbab165103b..fe6e46fb657 100644 --- a/plugins/in_elasticsearch/in_elasticsearch_bulk_conn.c +++ b/plugins/in_elasticsearch/in_elasticsearch_bulk_conn.c @@ -116,10 +116,9 @@ static int in_elasticsearch_bulk_conn_event(void *data) } if (NULL != request_end) { - request_len = (size_t) ((uintptr_t) request_end - - (uintptr_t) conn->buf_data); + request_len = (size_t)(request_end - conn->buf_data); - if (request_len < conn->buf_len) { + if (0 < (conn->buf_len - request_len)) { memmove(conn->buf_data, &conn->buf_data[request_len], conn->buf_len - request_len);