[glib/wip/gcleanup] data-output-stream: Fix some access after free
- From: Stefan Walter <stefw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/wip/gcleanup] data-output-stream: Fix some access after free
- Date: Sun, 10 Nov 2013 21:37:02 +0000 (UTC)
commit 3bbfc2514909dc92ed04ef078a5359aec49d51d8
Author: Stef Walter <stefw gnome org>
Date: Sun Nov 10 16:39:45 2013 +0100
data-output-stream: Fix some access after free
The memory pointed to by a GMemoryOutputStream can be realloc'd
https://bugzilla.gnome.org/show_bug.cgi?id=711802
gio/tests/data-output-stream.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gio/tests/data-output-stream.c b/gio/tests/data-output-stream.c
index 2ea0cb7..98374af 100644
--- a/gio/tests/data-output-stream.c
+++ b/gio/tests/data-output-stream.c
@@ -450,6 +450,7 @@ test_truncate (void)
g_assert (res);
g_assert_cmpint (g_memory_output_stream_get_size (base_stream), ==, len);
g_assert_cmpint (g_memory_output_stream_get_data_size (base_stream), ==, 4);
+ stream_data = g_memory_output_stream_get_data (base_stream);
g_assert_cmpint (stream_data[0], ==, 0x01);
g_assert_cmpint (stream_data[1], ==, 0x23);
g_assert_cmpint (stream_data[2], ==, 0x45);
@@ -461,6 +462,7 @@ test_truncate (void)
g_assert (res);
g_assert_cmpint (g_memory_output_stream_get_size (base_stream), ==, 4);
g_assert_cmpint (g_memory_output_stream_get_data_size (base_stream), ==, 4);
+ stream_data = g_memory_output_stream_get_data (base_stream);
g_assert_cmpint (stream_data[0], ==, 0x01);
g_assert_cmpint (stream_data[1], ==, 0x23);
g_assert_cmpint (stream_data[2], ==, 0x45);
@@ -472,6 +474,7 @@ test_truncate (void)
g_assert (res);
g_assert_cmpint (g_memory_output_stream_get_size (base_stream), ==, 6);
g_assert_cmpint (g_memory_output_stream_get_data_size (base_stream), ==, 4);
+ stream_data = g_memory_output_stream_get_data (base_stream);
g_assert_cmpint (stream_data[0], ==, 0x01);
g_assert_cmpint (stream_data[1], ==, 0x23);
g_assert_cmpint (stream_data[2], ==, 0x45);
@@ -483,6 +486,7 @@ test_truncate (void)
g_assert (res);
g_assert_cmpint (g_memory_output_stream_get_size (base_stream), ==, 2);
g_assert_cmpint (g_memory_output_stream_get_data_size (base_stream), ==, 2);
+ stream_data = g_memory_output_stream_get_data (base_stream);
g_assert_cmpint (stream_data[0], ==, 0x01);
g_assert_cmpint (stream_data[1], ==, 0x23);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]