From ca0b7b50202be55a6bd09546beeef9896e7182fd Mon Sep 17 00:00:00 2001 From: Vadim Kuper Date: Thu, 16 Jan 2020 13:21:47 -0800 Subject: [PATCH] Make sure negative long numbers do not crash LogRecordStreamReader --- Lib/ClassLibraryCommon/Analytics/LogRecordStreamReader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/ClassLibraryCommon/Analytics/LogRecordStreamReader.cs b/Lib/ClassLibraryCommon/Analytics/LogRecordStreamReader.cs index ed477b706..212cf4663 100644 --- a/Lib/ClassLibraryCommon/Analytics/LogRecordStreamReader.cs +++ b/Lib/ClassLibraryCommon/Analytics/LogRecordStreamReader.cs @@ -274,7 +274,7 @@ public void EndCurrentRecord() } else { - return long.Parse(temp, NumberStyles.None, CultureInfo.InvariantCulture); + return Math.Max(0, long.Parse(temp, NumberStyles.AllowLeadingSign, CultureInfo.InvariantCulture)); } }