projects
/
platform
/
upstream
/
glib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96671ce
)
GDataInputStream: don't segfault on async line reads
author
Giovanni Campagna
<gcampagna@src.gnome.org>
Mon, 13 Feb 2012 15:41:20 +0000
(16:41 +0100)
committer
Giovanni Campagna
<gcampagna@src.gnome.org>
Tue, 14 Feb 2012 18:04:07 +0000
(19:04 +0100)
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
gio/gdatainputstream.c
patch
|
blob
|
history
diff --git
a/gio/gdatainputstream.c
b/gio/gdatainputstream.c
index
d5dd2fd
..
ea26aeb
100644
(file)
--- a/
gio/gdatainputstream.c
+++ b/
gio/gdatainputstream.c
@@
-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,