From ecadffe0ae8c48b8b01f6c1331f153ea9776145b Mon Sep 17 00:00:00 2001 From: Konrad Dysput Date: Wed, 26 Jun 2024 10:41:49 +0200 Subject: [PATCH] Make sure we never check values outside _logSize queue (#220) * Make sure we never check values outside _logSize queue * Do not use unsupported API --- .../Model/Breadcrumbs/Storage/BacktraceStorageLogManager.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Runtime/Model/Breadcrumbs/Storage/BacktraceStorageLogManager.cs b/Runtime/Model/Breadcrumbs/Storage/BacktraceStorageLogManager.cs index be6462fd..5df420c6 100644 --- a/Runtime/Model/Breadcrumbs/Storage/BacktraceStorageLogManager.cs +++ b/Runtime/Model/Breadcrumbs/Storage/BacktraceStorageLogManager.cs @@ -290,6 +290,11 @@ private long GetNextStartPosition() int nextLineBytes = NewRow.Length; while (numberOfFreeBytes < expectedFreedBytes) { + if (_logSize.Count == 0) + { + return numberOfFreeBytes; + } + numberOfFreeBytes += (_logSize.Dequeue() + nextLineBytes); }