From aec796b212d4ab74899d1e5e3f1c8c2150481397 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Mon, 25 Jan 2021 08:15:08 -0800 Subject: [PATCH] [ntcore] Fix conditional jump on uninitialized value (#3125) `m_last_flush` should be initialized before it's used at Dispatcher.cpp:243. --- ntcore/src/main/native/cpp/Dispatcher.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ntcore/src/main/native/cpp/Dispatcher.h b/ntcore/src/main/native/cpp/Dispatcher.h index bbe9ad9745..f5767d04dc 100644 --- a/ntcore/src/main/native/cpp/Dispatcher.h +++ b/ntcore/src/main/native/cpp/Dispatcher.h @@ -112,7 +112,7 @@ class DispatcherBase : public IDispatcher { // Condition variable for forced dispatch wakeup (flush) wpi::mutex m_flush_mutex; wpi::condition_variable m_flush_cv; - uint64_t m_last_flush; + uint64_t m_last_flush = 0; bool m_do_flush = false; // Condition variable for client reconnect (uses user mutex)