GtkIMContextIME: Avoid committing NULL string
We may get invalid UTF-16 sequences when third party apps or hooks inject WM_CHAR messages. Validate the unicode string before committing. Fixes https://gitlab.com/inkscape/inkscape/-/issues/2088
This commit is contained in:
		| @ -336,6 +336,9 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context, | ||||
|     return FALSE; | ||||
|  | ||||
|   utf8 = g_utf16_to_utf8 (event_priv->translation, event_priv->translation_len, NULL, NULL, NULL); | ||||
|   if (!utf8) | ||||
|     return FALSE; | ||||
|  | ||||
|   g_signal_emit_by_name (context_ime, "commit", utf8); | ||||
|   g_free (utf8); | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Luca Bacci
					Luca Bacci