Rémi Bernon (@rbernon) commented about dlls/winewayland.drv/wayland_text_input.c:
+ preedit_len - byte_idx);
-done: + if (bytes_parsed <= 0) + break; + + byte_idx += bytes_parsed; + } + } + + if (!(wide_preedit = get_wide_string(text_input->preedit_string))) + { + ERR("Failed to allocate memory for wide IME preedit string.\n"); + preedit_cursor_pos = 0; + } + } What about something like this?
```suggestion:-26+0 if (!(wide_preedit = strdupAtoW(text_input->preedit_string))) preedit_cursor_pos = 0; else if (!(tmp = malloc(text_input->cursor_begin + 1)) preedit_cursor_pos = 0; else { preedit_cursor_pos = ntdll_umbstowcs(text_input->preedit_string, text_input->cursor_begin, tmp, text_input->cursor_begin); free(tmp); } ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7241#note_94572