summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2017-01-27 14:02:11 +0000
committerPhilip Withnall <withnall@endlessm.com>2017-08-08 09:05:26 +0100
commit63f008bd20df3bd3379c8e17ff244b10c91859de (patch)
treeaddb237c54b158aa962bc7d7806509ef06f4a6ae /tools
parentdfe34c8757debd07d4ef2f6f0381b2bcac1addc0 (diff)
downloadlibrsvg-63f008bd20df3bd3379c8e17ff244b10c91859de.tar.gz
tools: Fix an incorrect g_new() call
It was allocating an array of guint8 pointers, rather than an array of guint8s. This resulted in an allocation 4 times too large, which is a bug, but not one which would cause crashes. Coverity ID: 1398303 https://bugzilla.gnome.org/show_bug.cgi?id=777833
Diffstat (limited to 'tools')
-rw-r--r--tools/rsvg-tools-main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/rsvg-tools-main.c b/tools/rsvg-tools-main.c
index bac7085c..33470f08 100644
--- a/tools/rsvg-tools-main.c
+++ b/tools/rsvg-tools-main.c
@@ -53,7 +53,7 @@ read_contents (const gchar *file_name, guint8 **contents, gsize *length)
gsize bytes_read;
*length = g_file_info_get_size (file_info);
- *contents = (guint8 *) g_new (guint8*, *length);
+ *contents = g_new (guint8, *length);
success = g_input_stream_read_all (G_INPUT_STREAM(input_stream),
*contents,
*length,