Merge pull request #37504 from qarmin/out_of_bound_cursor

Fix array out of bounds access caused by uninitialised variables
This commit is contained in:
Rémi Verschelde 2020-04-02 13:07:55 +02:00 committed by GitHub
commit 5f11e15571
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 48 additions and 20 deletions

View file

@ -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;
@ -3650,14 +3659,6 @@ DisplayServerX11::DisplayServerX11(const String &p_rendering_driver, WindowMode
cursor_theme = "default";
}
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[] = {