mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-21 02:58:08 +08:00
Fix use of uninitialized cursor variable (#1111)
Some checks failed
Build / Bazel, cl, windows-latest (push) Has been cancelled
Build / Bazel, clang++, macos-latest (push) Has been cancelled
Build / Bazel, clang++, ubuntu-latest (push) Has been cancelled
Build / Bazel, g++, macos-latest (push) Has been cancelled
Build / Bazel, g++, ubuntu-latest (push) Has been cancelled
Build / CMake, cl, windows-latest (push) Has been cancelled
Build / CMake, gcc, ubuntu-latest (push) Has been cancelled
Build / CMake, llvm, ubuntu-latest (push) Has been cancelled
Build / CMake, llvm, macos-latest (push) Has been cancelled
Build / Test modules (llvm, ubuntu-latest) (push) Has been cancelled
Documentation / documentation (push) Has been cancelled
Some checks failed
Build / Bazel, cl, windows-latest (push) Has been cancelled
Build / Bazel, clang++, macos-latest (push) Has been cancelled
Build / Bazel, clang++, ubuntu-latest (push) Has been cancelled
Build / Bazel, g++, macos-latest (push) Has been cancelled
Build / Bazel, g++, ubuntu-latest (push) Has been cancelled
Build / CMake, cl, windows-latest (push) Has been cancelled
Build / CMake, gcc, ubuntu-latest (push) Has been cancelled
Build / CMake, llvm, ubuntu-latest (push) Has been cancelled
Build / CMake, llvm, macos-latest (push) Has been cancelled
Build / Test modules (llvm, ubuntu-latest) (push) Has been cancelled
Documentation / documentation (push) Has been cancelled
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 <bgwin@google.com>
This commit is contained in:
@@ -60,7 +60,7 @@ class Screen : public Image {
|
||||
BarBlinking = 5,
|
||||
Bar = 6,
|
||||
};
|
||||
Shape shape;
|
||||
Shape shape = Hidden;
|
||||
};
|
||||
|
||||
Cursor cursor() const { return cursor_; }
|
||||
|
Reference in New Issue
Block a user