diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-02 13:07:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-02 13:07:55 +0200 |
commit | 5f11e1557156617366d2c316a97716172103980d (patch) | |
tree | 288d8275067df46a8fc58e99184c74955de39bd8 /platform/linuxbsd | |
parent | 7341a8fe1df65dc4d36aa49938575b6099764c0a (diff) | |
parent | 359bebd8c08a626e64ade1ac45c3c925352bd8a4 (diff) |
Merge pull request #37504 from qarmin/out_of_bound_cursor
Fix array out of bounds access caused by uninitialised variables
Diffstat (limited to 'platform/linuxbsd')
-rw-r--r-- | platform/linuxbsd/display_server_x11.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp index c2b5657081..786bc37bad 100644 --- a/platform/linuxbsd/display_server_x11.cpp +++ b/platform/linuxbsd/display_server_x11.cpp @@ -3374,6 +3374,15 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode r_error = OK; + current_cursor = CURSOR_ARROW; + mouse_mode = MOUSE_MODE_VISIBLE; + + for (int i = 0; i < CURSOR_MAX; i++) { + + cursors[i] = None; + img[i] = NULL; + } + last_button_state = 0; xmbstring = NULL; @@ -3652,14 +3661,6 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode for (int i = 0; i < CURSOR_MAX; i++) { - cursors[i] = None; - img[i] = NULL; - } - - current_cursor = CURSOR_ARROW; - - for (int i = 0; i < CURSOR_MAX; i++) { - static const char *cursor_file[] = { "left_ptr", "xterm", |