blob: 9957be82f371860fdbf51d6bafe615000d6b6f50 [file] [log] [blame]
Andrew Geisslereef63862021-01-29 15:58:13 -06001From 799eb6a3af8a3dd81e2429bf11a72a57e541f908 Mon Sep 17 00:00:00 2001
2From: "Eric S. Raymond" <esr@thyrsus.com>
3Date: Sun, 17 Mar 2019 12:37:21 -0400
4Subject: [PATCH] Address SF bug #119: MemorySanitizer: FPE on unknown address
5
6---
7 dgif_lib.c | 2 +-
8 1 file changed, 1 insertion(+), 1 deletion(-)
9
10Upstream-status: Backport [https://sourceforge.net/p/giflib/code/ci/799eb6a3af8a3dd81e2429bf11a72a57e541f908/]
11CVE: CVE-2019-15133
12
13--- a/lib/dgif_lib.c 2021-01-13 19:28:18.923493586 +0100
14+++ b/lib/dgif_lib.c 2021-01-13 19:28:55.245863085 +0100
15@@ -1099,7 +1099,7 @@ DGifSlurp(GifFileType *GifFile)
16
17 sp = &GifFile->SavedImages[GifFile->ImageCount - 1];
18 /* Allocate memory for the image */
19- if (sp->ImageDesc.Width < 0 && sp->ImageDesc.Height < 0 &&
20+ if (sp->ImageDesc.Width <= 0 && sp->ImageDesc.Height <= 0 &&
21 sp->ImageDesc.Width > (INT_MAX / sp->ImageDesc.Height)) {
22 return GIF_ERROR;
23 }