From 2dcf2ab53c6931f36d8744ab7bbb31a3a800bddb Mon Sep 17 00:00:00 2001 From: Neil Bertram Date: Wed, 16 Jun 2021 15:44:12 +1200 Subject: [PATCH] out_cloudwatch: Fix integer overflow on 32 bit systems when converting tv_sec to millis (#3640) --- plugins/out_cloudwatch_logs/cloudwatch_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/out_cloudwatch_logs/cloudwatch_api.c b/plugins/out_cloudwatch_logs/cloudwatch_api.c index ac483bf07fa..9126c6848ca 100644 --- a/plugins/out_cloudwatch_logs/cloudwatch_api.c +++ b/plugins/out_cloudwatch_logs/cloudwatch_api.c @@ -435,7 +435,7 @@ int process_event(struct flb_cloudwatch *ctx, struct cw_flush *buf, event = &buf->events[buf->event_index]; event->json = tmp_buf_ptr; event->len = written; - event->timestamp = (unsigned long long) (tms->tm.tv_sec * 1000 + + event->timestamp = (unsigned long long) (tms->tm.tv_sec * 1000ull + tms->tm.tv_nsec/1000000); }