[gdk-pixbuf] gdk-pixbuf-io: Check length before checking for pixdata magic



commit ac95d0de26ed37d2cb05dfff7455ae84089a3b2d
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jul 5 23:23:23 2017 +0200

    gdk-pixbuf-io: Check length before checking for pixdata magic
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784583

 gdk-pixbuf/gdk-pixbuf-io.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index 61a61a8..1669815 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.c
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
@@ -1665,6 +1665,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
         * compressed, and uncompressed on-the-fly.
          */
        if (g_resources_get_info  (resource_path, 0, &data_size, NULL, NULL) &&
+           data_size > sizeof(guint32) &&
            (bytes = g_resources_lookup_data (resource_path, 0, NULL)) != NULL) {
                GdkPixbuf*pixbuf = NULL;
                const guint8 *stream = g_bytes_get_data (bytes, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]