From 0379acfd5f74f9756a8187cc0b4c6e12f35109f4 Mon Sep 17 00:00:00 2001 From: Benjamin Gwin Date: Fri, 5 Sep 2025 22:08:48 +0000 Subject: [PATCH] Fix use of uninitialized cursor variable 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. --- 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 efde98e42..27bca9936 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_; }