From 1817280e01ae0d7f273f9f9bf7845129b3422d1c Mon Sep 17 00:00:00 2001 From: Jaaaky <43599380+Jaaaky@users.noreply.github.com> Date: Sat, 4 Jan 2020 13:29:22 +0200 Subject: [PATCH] AP_Logger: fix 'last_file' may be used uninitialized with debug build --- libraries/AP_Logger/AP_Logger_Block.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_Logger/AP_Logger_Block.cpp b/libraries/AP_Logger/AP_Logger_Block.cpp index 7903bbefba..03b46a5c0d 100644 --- a/libraries/AP_Logger/AP_Logger_Block.cpp +++ b/libraries/AP_Logger/AP_Logger_Block.cpp @@ -264,7 +264,7 @@ void AP_Logger_Block::validate_log_structure() uint16_t file = GetFileNumber(); uint16_t first_file = file; uint16_t next_file = file; - uint16_t last_file; + uint16_t last_file = 0; while (file != 0xFFFF && page <= df_NumPages && (file == next_file || (wrapped && file < next_file))) { uint32_t end_page = find_last_page_of_log(file);