Fix read of uninitialised variable

If the condition (dbus->message_iter_get_arg_type(&sub) == DBUS_TYPE_STRING) is false, subtext is not initialised.
This commit is contained in:
Mathieu Eyraud 2022-06-18 16:59:35 +02:00 committed by Ozkan Sezer
parent d51a8f530e
commit 00b95e989b
1 changed files with 1 additions and 0 deletions

View File

@ -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) {