This repository has been archived by the owner on Oct 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libjpeg-turbo-soname8: Fix for CVE-2019-2201
libjpeg-turbo/libjpeg-turbo#388 Minor backport of: libjpeg-turbo/libjpeg-turbo@c30b1e7 "64-bit tjbench: Fix signed int overflow/segfault that occurred when attempting to decompress images with more than 715827882 (2048*1024*1024 / 3) pixels." CVEs fixed in this build: CVE-2019-2201
- Loading branch information
1 parent
2a42842
commit 39828c3
Showing
5 changed files
with
72 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
From 6548377e7ed7653e555dac0b9faa4152b00ecbaf Mon Sep 17 00:00:00 2001 | ||
From: DRC <information@libjpeg-turbo.org> | ||
Date: Tue, 12 Nov 2019 12:11:54 -0800 | ||
Subject: [PATCH] 64-bit tjbench: Fix signed int overflow/segfault | ||
|
||
... that occurred when attempting to decompress images with more than | ||
715827882 (2048*1024*1024 / 3) pixels. | ||
|
||
Fixes #388 | ||
--- | ||
ChangeLog.md | 4 ++++ | ||
tjbench.c | 4 ++-- | ||
2 files changed, 6 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/ChangeLog.md b/ChangeLog.md | ||
index f5fe44b..4e501c5 100644 | ||
--- a/ChangeLog.md | ||
+++ b/ChangeLog.md | ||
@@ -41,6 +41,10 @@ end of a single-scan (non-progressive) image, subsequent calls to | ||
JPEG images that were compressed with a sampling factor other than 1 (for | ||
instance, with `cjpeg -grayscale -sample 2x2`). | ||
|
||
+2. Fixed a signed integer overflow and subsequent segfault that occurred when | ||
+attempting to decompress images with more than 715827882 pixels using the | ||
+64-bit C version of TJBench. | ||
+ | ||
|
||
1.5.2 | ||
===== | ||
diff --git a/tjbench.c b/tjbench.c | ||
index 76b61cd..393c014 100644 | ||
--- a/tjbench.c | ||
+++ b/tjbench.c | ||
@@ -133,7 +133,7 @@ int decomp(unsigned char *srcbuf, unsigned char **jpegbuf, | ||
} | ||
/* Set the destination buffer to gray so we know whether the decompressor | ||
attempted to write to it */ | ||
- memset(dstbuf, 127, pitch*scaledh); | ||
+ memset(dstbuf, 127, (size_t)pitch * scaledh); | ||
|
||
if(doyuv) | ||
{ | ||
@@ -152,7 +152,7 @@ int decomp(unsigned char *srcbuf, unsigned char **jpegbuf, | ||
{ | ||
int tile=0; | ||
double start=gettime(); | ||
- for(row=0, dstptr=dstbuf; row<ntilesh; row++, dstptr+=pitch*tileh) | ||
+ for(row=0, dstptr=dstbuf; row<ntilesh; row++, dstptr+=(size_t)pitch*tileh) | ||
{ | ||
for(col=0, dstptr2=dstptr; col<ntilesw; col++, tile++, dstptr2+=ps*tilew) | ||
{ | ||
-- | ||
2.24.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
46 | ||
47 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
cve-2017-15232.patch | ||
CVE-2018-14498.patch | ||
CVE-2019-2201.patch |