mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-04 14:24:57 +08:00
wayland: Don't pass null string pointers to wl_cursor_theme_get_cursor
The function calls strcmp internally without checking for a null string parameter, and calling strcmp with a null parameter is undefined behavior.
(cherry picked from commit f24216c2ba)
This commit is contained in:
@@ -259,7 +259,7 @@ static SDL_bool wayland_get_system_cursor(SDL_VideoData *vdata, Wayland_CursorDa
|
|||||||
cssname = SDL_GetCSSCursorName(cdata->system_cursor, &fallback_name);
|
cssname = SDL_GetCSSCursorName(cdata->system_cursor, &fallback_name);
|
||||||
|
|
||||||
cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, cssname);
|
cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, cssname);
|
||||||
if (!cursor) {
|
if (!cursor && fallback_name) {
|
||||||
cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, fallback_name);
|
cursor = WAYLAND_wl_cursor_theme_get_cursor(theme, fallback_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user