From f21fcc19955398a01dd448a622d6e7e06e8e4d06 Mon Sep 17 00:00:00 2001 From: Benjamin Gwin Date: Mon, 8 Sep 2025 22:34:35 -0700 Subject: [PATCH] Fix use of uninitialized cursor variable (#1111) The cursor_ variable was being default initialized, which causes undefined behaviour when accessing properties in ScreenInteractive::Draw. This caused a crash when running with UBSAN. ``` ftxui/src/ftxui/component/screen_interactive.cpp:852:17: runtime error: load of value 4195502944, which is not a valid value for type 'Shape' ``` This change causes the shape variable to be explicitly initialized, similar to the x and y members. Co-authored-by: Benjamin Gwin --- include/ftxui/screen/screen.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/ftxui/screen/screen.hpp b/include/ftxui/screen/screen.hpp index efde98e4..27bca993 100644 --- a/include/ftxui/screen/screen.hpp +++ b/include/ftxui/screen/screen.hpp @@ -60,7 +60,7 @@ class Screen : public Image { BarBlinking = 5, Bar = 6, }; - Shape shape; + Shape shape = Hidden; }; Cursor cursor() const { return cursor_; }