openbsd-ports/graphics/gdk-pixbuf/patches/patch-gdk-pixbuf_io-ico_c
brad 051e65a1bf fixes a DoS issue with the BMP decoder, integer overflow and heap-based
buffer overflow with the XPM decoder, and integer overflow with the ICO
decoder.

CAN-2004-0753, CAN-2004-0782, CAN-2004-0788
2004-09-19 23:41:32 +00:00

16 lines
494 B
Plaintext

$OpenBSD: patch-gdk-pixbuf_io-ico_c,v 1.1 2004/09/19 23:41:32 brad Exp $
--- gdk-pixbuf/io-ico.c.orig Sat Sep 18 22:16:41 2004
+++ gdk-pixbuf/io-ico.c Sat Sep 18 22:17:54 2004
@@ -330,6 +330,11 @@ DecodeHeader (guchar *Data, gint Bytes,
State->HeaderSize+=I;
+ if (State->HeaderSize < 0) {
+ g_error ("DecodeHeader(): Invalid header in icon");
+ return;
+ }
+
if (State->HeaderSize>State->BytesInHeaderBuf) {
guchar *tmp=realloc(State->HeaderBuf,State->HeaderSize);
if (!tmp)