From 00b95e989b68ca057662263a18a4df576786555a Mon Sep 17 00:00:00 2001 From: Mathieu Eyraud <70028899+meyraud705@users.noreply.github.com> Date: Sat, 18 Jun 2022 16:59:35 +0200 Subject: [PATCH] Fix read of uninitialised variable If the condition (dbus->message_iter_get_arg_type(&sub) == DBUS_TYPE_STRING) is false, subtext is not initialised. --- src/core/linux/SDL_fcitx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/linux/SDL_fcitx.c b/src/core/linux/SDL_fcitx.c index 1ce8bd11f..c7a735923 100644 --- a/src/core/linux/SDL_fcitx.c +++ b/src/core/linux/SDL_fcitx.c @@ -105,6 +105,7 @@ Fcitx_GetPreeditString(SDL_DBusContext *dbus, dbus->message_iter_recurse(&iter, &array); while (dbus->message_iter_get_arg_type(&array) == DBUS_TYPE_STRUCT) { dbus->message_iter_recurse(&array, &sub); + subtext = NULL; if (dbus->message_iter_get_arg_type(&sub) == DBUS_TYPE_STRING) { dbus->message_iter_get_basic(&sub, &subtext); if (subtext && *subtext) {