Commit 49141996659c1a802d8d93992cacd3fb2ea5977e

Ryan C. Gordon 2021-04-04T00:29:26

ibus: make sure we don't pass a NULL path string over D-Bus. Fixes #2941.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c
index 256926d..975955c 100644
--- a/src/core/linux/SDL_ibus.c
+++ b/src/core/linux/SDL_ibus.c
@@ -484,7 +484,7 @@ IBus_SimpleMessage(const char *method)
 {   
     SDL_DBusContext *dbus = SDL_DBus_GetContext();
     
-    if (IBus_CheckConnection(dbus)) {
+    if ((input_ctx_path != NULL) && (IBus_CheckConnection(dbus))) {
         SDL_DBus_CallVoidMethodOnConnection(ibus_conn, IBUS_SERVICE, input_ctx_path, IBUS_INPUT_INTERFACE, method, DBUS_TYPE_INVALID);
     }
 }