summaryrefslogtreecommitdiff
path: root/gio/src/memoryinputstream.ccg
diff options
context:
space:
mode:
authorAlexey Kosilin <kosilin@gmail.com>2010-03-23 18:17:33 +0100
committerMurray Cumming <murrayc@murrayc.com>2010-03-23 18:17:33 +0100
commit9ebcebfdaa42d87ffb2fb0668d1b28d11e161713 (patch)
treed50874f228fad4a72704f792b3a73b4e8d195de0 /gio/src/memoryinputstream.ccg
parentc73eedc32e74237668e7ced4560ea7492796a29c (diff)
downloadglibmm-9ebcebfdaa42d87ffb2fb0668d1b28d11e161713.tar.gz
MemoryInputStream: Correct data loss/corruption with binary data.
* gio/src/memoryinputstream.ccg: add_data(): Use g_memdup() instead of g_strdup() on data that could have a null in the middle. Bug #609552 (Holger Seelig)
Diffstat (limited to 'gio/src/memoryinputstream.ccg')
-rw-r--r--gio/src/memoryinputstream.ccg2
1 files changed, 1 insertions, 1 deletions
diff --git a/gio/src/memoryinputstream.ccg b/gio/src/memoryinputstream.ccg
index 7f6aaf8a..0801e029 100644
--- a/gio/src/memoryinputstream.ccg
+++ b/gio/src/memoryinputstream.ccg
@@ -37,7 +37,7 @@ void MemoryInputStream::add_data(const void* data, gssize len)
if (len < 0)
data_copy = g_strdup (static_cast<const gchar*>(data));
else
- data_copy = g_strndup (static_cast<const gchar*>(data), len);
+ data_copy = static_cast<gchar*>(g_memdup (data, len));
g_memory_input_stream_add_data(gobj(), data_copy, len, g_free);
}