Check for overflow in one more place. (#313818, Tommi Komulainen)

2005-08-18  Matthias Clasen  <mclasen@redhat.com>

	* io-ico.c (DecodeHeader): Check for overflow in one more
	place.  (#313818, Tommi Komulainen)
This commit is contained in:
Matthias Clasen 2005-08-18 14:18:02 +00:00 committed by Matthias Clasen
parent 86685d2ad0
commit 485b4f523f
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-08-18 Matthias Clasen <mclasen@redhat.com>
* io-ico.c (DecodeHeader): Check for overflow in one more
place. (#313818, Tommi Komulainen)
2005-08-15 Matthias Clasen <mclasen@redhat.com>
* io-jpeg.c (fatal_error_handler): Pay attention to the

View File

@ -261,7 +261,15 @@ static void DecodeHeader(guchar *Data, gint Bytes,
so we know how many bytes are in the "header" part. */
State->HeaderSize = State->DIBoffset + 40; /* 40 = sizeof(InfoHeader) */
if (State->HeaderSize < 0) {
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("Invalid header in icon"));
return;
}
if (State->HeaderSize>State->BytesInHeaderBuf) {
guchar *tmp=g_try_realloc(State->HeaderBuf,State->HeaderSize);
if (!tmp) {