gutf8: add string length check when ending character offset is -1
Some function such as atk_text_get_text, use -1 to indicate the end of the string. And an crash occurs when the -1 is passed to g_utf8_substring.
Call Trace: 0 __memmove_avx_unaligned_erms 1 memcpy 2 g_utf8_substring 3 impl_GetText 4 handle_other 5 handle_message 6 _dbus_object_tree_dispatch_and_unlock 7 dbus_connection_dispatch 8 dbus_connection_dispatch 9 () 10 g_main_dispatch 11 g_main_context_dispatch 12 g_main_context_iterate 13 g_main_context_iteration 14 g_application_run 15 main
Signed-off-by: Chen Guanqiao chen.chenchacha@foxmail.com