mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 19:06:15 +01:00
GDataInputStream: don't segfault on async line reads
If an async line read fails, it returns NULL. In that case, we must return NULL before validating the line, or we segfault. https://bugzilla.gnome.org/show_bug.cgi?id=658484
This commit is contained in:
parent
96671ce815
commit
5b8a6900d3
@ -1284,6 +1284,9 @@ g_data_input_stream_read_line_finish_utf8 (GDataInputStream *stream,
|
||||
gchar *res;
|
||||
|
||||
res = g_data_input_stream_read_line_finish (stream, result, length, error);
|
||||
if (!res)
|
||||
return NULL;
|
||||
|
||||
if (!g_utf8_validate (res, -1, NULL))
|
||||
{
|
||||
g_set_error_literal (error, G_CONVERT_ERROR,
|
||||
|
Loading…
Reference in New Issue
Block a user