Skip to content

Commit

Permalink
Fix read of uninitialised variable
Browse files Browse the repository at this point in the history
If the condition (dbus->message_iter_get_arg_type(&sub) == DBUS_TYPE_STRING) is false, subtext is not initialised.
  • Loading branch information
meyraud705 authored and sezero committed Jun 18, 2022
1 parent d51a8f5 commit 00b95e9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/linux/SDL_fcitx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 00b95e9

Please sign in to comment.