[gdk-pixbuf] pixdata: Remove pixdata loader



commit 349fab92825573d45b41184d5027436fcd969cc4
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Dec 13 11:04:46 2016 +0100

    pixdata: Remove pixdata loader
    
    This won't stop pixdata-encoded data from being mmap'ed directly
    from the binary when using GResource, but will stop external files from
    being loaded, and thus block a possible attack vector.
    
    This also adjusts the new pixdata tests to make sure that external
    pixdata files fail to load.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776004

 gdk-pixbuf/Makefile.am     |    9 --
 gdk-pixbuf/gdk-pixbuf-io.c |    6 --
 gdk-pixbuf/io-pixdata.c    |  195 --------------------------------------------
 tests/pixbuf-pixdata.c     |    6 +-
 4 files changed, 3 insertions(+), 213 deletions(-)
---
diff --git a/gdk-pixbuf/Makefile.am b/gdk-pixbuf/Makefile.am
index 75f3e6b..e492db8 100644
--- a/gdk-pixbuf/Makefile.am
+++ b/gdk-pixbuf/Makefile.am
@@ -43,11 +43,6 @@ libpixbufloader_bmp_la_LDFLAGS = -avoid-version -module $(no_undefined)
 libpixbufloader_bmp_la_LIBADD = $(module_libs)
 
 #
-# The GdkPixdata loader, always built in
-#
-libstatic_pixbufloader_pixdata_la_SOURCES = io-pixdata.c
-
-#
 # The GIF loader
 #
 libstatic_pixbufloader_gif_la_SOURCES = io-gif.c io-gif-animation.c io-gif-animation.h
@@ -384,9 +379,6 @@ else
 QTIF_LIB = libpixbufloader-qtif.la
 endif
 
-# Always included
-STATIC_PIXDATA_LIB = libstatic-pixbufloader-pixdata.la
-
 if BUILD_DYNAMIC_MODULES
 
 loader_LTLIBRARIES =   \
@@ -613,7 +605,6 @@ gdk_pixbuf_FILES = \
        $(libgdk_pixbuf_2_0_la_SOURCES)         \
        $(libstatic_pixbufloader_ani_la_SOURCES)        \
        $(libstatic_pixbufloader_icns_la_SOURCES)       \
-       $(libstatic_pixbufloader_pixdata_la_SOURCES)    \
        $(libstatic_pixbufloader_pnm_la_SOURCES)        \
        $(libstatic_pixbufloader_png_la_SOURCES)        \
        $(libstatic_pixbufloader_qtif_la_SOURCES)       \
diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
index b81d3d2..3e9e868 100644
--- a/gdk-pixbuf/gdk-pixbuf-io.c
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
@@ -424,9 +424,6 @@ gdk_pixbuf_io_init (void)
         else                                                            \
                 g_free (builtin_module)
 
-       /* Always include GdkPixdata format */
-        load_one_builtin_module (pixdata);
-
 #ifdef INCLUDE_ani
         load_one_builtin_module (ani);
 #endif
@@ -650,7 +647,6 @@ gdk_pixbuf_io_init (void)
   extern void _gdk_pixbuf__##type##_fill_info   (GdkPixbufFormat *info);   \
   extern void _gdk_pixbuf__##type##_fill_vtable (GdkPixbufModule *module)
 
-module (pixdata);
 module (png);
 module (jpeg);
 module (gif);
@@ -696,8 +692,6 @@ gdk_pixbuf_load_module_unlocked (GdkPixbufModule *image_module,
                 fill_vtable = _gdk_pixbuf__##id##_fill_vtable;  \
         }
 
-        try_module (pixdata,pixdata);
-
 #ifdef INCLUDE_gdiplus
         try_module (ico,gdip_ico);
         try_module (wmf,gdip_wmf);
diff --git a/tests/pixbuf-pixdata.c b/tests/pixbuf-pixdata.c
index 7ede35a..4cb7d1c 100644
--- a/tests/pixbuf-pixdata.c
+++ b/tests/pixbuf-pixdata.c
@@ -37,9 +37,9 @@ test_pixdata (void)
 
   path = g_test_get_filename (G_TEST_DIST, "test-image.pixdata", NULL);
   ref = gdk_pixbuf_new_from_file (path, &error);
-  g_assert_no_error (error);
-
-  g_object_unref (ref);
+  g_assert_error (error, GDK_PIXBUF_ERROR, GDK_PIXBUF_ERROR_UNKNOWN_TYPE);
+  g_clear_error (&error);
+  g_clear_object (&ref);
 }
 
 int


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