Search
j0ke.net Open Build Service
>
Projects
>
multimedia
:
EL6
:
ffmpeg-0.11.x
>
xmms
> xmms-1.2.11-ubuntu-CVE-2007-0653.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File xmms-1.2.11-ubuntu-CVE-2007-0653.patch of Package xmms
--- xmms-1.2.11/xmms/bmp.c.orig 2006-07-16 15:40:04.000000000 +0200 +++ xmms-1.2.11/xmms/bmp.c 2008-01-13 08:50:13.000000000 +0100 @@ -19,6 +19,12 @@ */ #include "xmms.h" +#if HAVE_STDINT_H +#include <stdint.h> +#elif !defined(UINT32_MAX) +#define UINT32_MAX 0xffffffffU +#endif + struct rgb_quad { guchar rgbBlue; @@ -183,7 +189,7 @@ } else if (bitcount != 24 && bitcount != 16 && bitcount != 32) { - gint ncols, i; + guint32 ncols, i; ncols = offset - headSize - 14; if (headSize == 12) @@ -201,6 +207,15 @@ } } fseek(file, offset, SEEK_SET); + /* verify buffer size */ + if (!h || !w || + w > (((UINT32_MAX - 3) / 3) / h) || + h > (((UINT32_MAX - 3) / 3) / w)) { + g_warning("read_bmp(): width(%u)*height(%u) too large", w, h); + fclose(file); + return NULL; + } + data = g_malloc0((w * 3 * h) + 3); /* +3 is just for safety */ buffer = g_malloc(imgsize); fread(buffer, imgsize, 1, file); data = g_malloc0((w * 3 * h) + 3); /* +3 is just for safety */