From d7fcaee15aeb142eddbcf57d999f393bf95834d5 Mon Sep 17 00:00:00 2001 From: Joseph Cosentino Date: Wed, 21 Aug 2024 15:37:34 -0700 Subject: [PATCH] fix: sanity check startPosition --- .../greengrass/logmanager/CloudWatchAttemptLogsProcessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/aws/greengrass/logmanager/CloudWatchAttemptLogsProcessor.java b/src/main/java/com/aws/greengrass/logmanager/CloudWatchAttemptLogsProcessor.java index b1932818..6d7f0812 100644 --- a/src/main/java/com/aws/greengrass/logmanager/CloudWatchAttemptLogsProcessor.java +++ b/src/main/java/com/aws/greengrass/logmanager/CloudWatchAttemptLogsProcessor.java @@ -138,7 +138,7 @@ public CloudWatchAttempt processLogFiles(ComponentLogFileInformation componentLo long startPosition = logFileInformation.getStartPosition(); String fileHash = logFileInformation.getFileHash(); //This has been handled in the service, but leave here to prevent processor crash - if (logFile.isEmpty() || startPosition == logFile.length()) { + if (logFile.isEmpty() || startPosition >= logFile.length()) { componentLogFileInformation.getLogFileInformationList().remove(0); continue; }