[eog/gnome-3-14] EogPrintPreview: Fix possible integer overflow



commit 0b02e1b43d28c05de73befb7af2d4bc057a00a65
Author: Felix Riemann <friemann gnome org>
Date:   Sun Feb 14 19:09:16 2016 +0100

    EogPrintPreview: Fix possible integer overflow
    
    Import a fix into code copied from GDK which was susceptible to a possible
    integer overflow (cf. CVE-2013-7447). This is practically the corresponding
    fix from GDK. The code in eog however should only work with images too small
    to trigger this integer overflow.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=762028

 src/eog-print-preview.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/eog-print-preview.c b/src/eog-print-preview.c
index 3710dff..57ce39d 100644
--- a/src/eog-print-preview.c
+++ b/src/eog-print-preview.c
@@ -727,7 +727,7 @@ create_surface_from_pixbuf (GdkPixbuf *pixbuf)
     format = CAIRO_FORMAT_ARGB32;
 
   cairo_stride = cairo_format_stride_for_width (format, width);
-  cairo_pixels = g_malloc (height * cairo_stride);
+  cairo_pixels = g_malloc_n (height, cairo_stride);
   surface = cairo_image_surface_create_for_data ((unsigned char *)cairo_pixels,
                                                 format,
                                                 width, height, cairo_stride);


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