Commit c7ec9c1d851e424d6223175df9f5870c0a39aab7

Edward Rudd 2015-04-01T16:11:37

handle the case where the ibus address can't be found. (prevents nasty crash)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/core/linux/SDL_ibus.c b/src/core/linux/SDL_ibus.c
index 1a0729f..6b84be2 100644
--- a/src/core/linux/SDL_ibus.c
+++ b/src/core/linux/SDL_ibus.c
@@ -462,6 +462,9 @@ SDL_IBus_Init(void)
         ibus_addr_file = SDL_strdup(addr_file);
         
         addr = IBus_ReadAddressFromFile(addr_file);
+        if (!addr) {
+            return SDL_FALSE;
+        }
         
         if (inotify_fd < 0) {
             inotify_fd = inotify_init();