[gdk-pixbuf] io-xpm: Handle fseek() failure



commit 3a53fc42e56f6c5fb896f557d5e892f14528fa47
Author: Philip Withnall <philip tecnocode co uk>
Date:   Sat Jan 7 16:40:16 2017 +0000

    io-xpm: Handle fseek() failure
    
    If fseek() fails, the image is corrupt, and so the call to this get_buf
    function should fail.
    
    Coverity CID: 1388523
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776990

 gdk-pixbuf/io-xpm.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gdk-pixbuf/io-xpm.c b/gdk-pixbuf/io-xpm.c
index 9f72bc5..a98b1f3 100644
--- a/gdk-pixbuf/io-xpm.c
+++ b/gdk-pixbuf/io-xpm.c
@@ -401,7 +401,8 @@ file_buffer (enum buf_op op, gpointer handle)
 
        case op_cmap:
                xpm_seek_char (h->infile, '"');
-               fseek (h->infile, -1, SEEK_CUR);
+               if (fseek (h->infile, -1, SEEK_CUR) != 0)
+                       return NULL;
                /* Fall through to the xpm_read_string. */
 
        case op_body:


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