Skip to content

Commit

Permalink
media-libs/libextractor: Patch CVE-2017-17440
Browse files Browse the repository at this point in the history
Bug: https://bugs.gentoo.org/635362
Package-Manager: Portage-2.3.19, Repoman-2.3.6
  • Loading branch information
a17r committed Dec 25, 2017
1 parent f144d03 commit 6859a8b
Show file tree
Hide file tree
Showing 2 changed files with 127 additions and 0 deletions.
125 changes: 125 additions & 0 deletions media-libs/libextractor/files/libextractor-1.6-CVE-2017-17440.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
From 7cc63b001ceaf81143795321379c835486d0c92e Mon Sep 17 00:00:00 2001
From: Christian Grothoff <[email protected]>
Date: Wed, 1 Nov 2017 09:07:35 +0100
Subject: fix misc NULL pointer exceptions

---
src/include/extractor.h | 2 +-
src/plugins/gif_extractor.c | 16 +++++++++-------
src/plugins/it_extractor.c | 6 +++---
src/plugins/nsfe_extractor.c | 8 ++++----
src/plugins/s3m_extractor.c | 2 +-
src/plugins/sid_extractor.c | 24 ++++++++++++------------
src/plugins/xm_extractor.c | 8 ++++----
21 files changed, 169 insertions(+), 162 deletions(-)

* asturm: Cleaned up unrelated whitespace and translations changes.

diff --git a/src/include/extractor.h b/src/include/extractor.h
index 0325dc6..782134b 100644
--- a/src/include/extractor.h
+++ b/src/include/extractor.h
@@ -35,7 +35,7 @@ extern "C" {
* 0.2.6-1 => 0x00020601
* 4.5.2-0 => 0x04050200
*/
-#define EXTRACTOR_VERSION 0x01060000
+#define EXTRACTOR_VERSION 0x01060001

#include <stdio.h>

diff --git a/src/plugins/gif_extractor.c b/src/plugins/gif_extractor.c
index aae2b82..8ee5807 100644
@@ -122,6 +122,8 @@ EXTRACTOR_gif_extract_method (struct EXTRACTOR_ExtractContext *ec)
if (GIF_OK !=
DGifGetExtension (gif_file, &et, &ext))
continue;
+ if (NULL == ext)
+ continue;
if (COMMENT_EXT_FUNC_CODE == et)
{
ec->proc (ec->cls,
--- a/src/plugins/it_extractor.c
+++ b/src/plugins/it_extractor.c
@@ -70,7 +70,7 @@ EXTRACTOR_it_extract_method (struct EXTRACTOR_ExtractContext *ec)
char itversion[8];
const struct Header *head;

- if (HEADER_SIZE >
+ if ((ssize_t) HEADER_SIZE >
ec->read (ec->cls,
&data,
HEADER_SIZE))
--- a/src/plugins/nsfe_extractor.c
+++ b/src/plugins/nsfe_extractor.c
@@ -175,7 +175,7 @@ info_extract (struct EXTRACTOR_ExtractContext *ec,

if (size < 8)
return 0;
- if (size >
+ if ((ssize_t) size >
ec->read (ec->cls,
&data,
size))
@@ -243,7 +243,7 @@ tlbl_extract (struct EXTRACTOR_ExtractContext *ec,
void *data;
const char *cdata;

- if (size >
+ if ((ssize_t) size >
ec->read (ec->cls,
&data,
size))
@@ -285,7 +285,7 @@ auth_extract (struct EXTRACTOR_ExtractContext *ec,

if (left < 1)
return 0;
- if (size >
+ if ((ssize_t) size >
ec->read (ec->cls,
&data,
size))
@@ -342,7 +342,7 @@ EXTRACTOR_nsfe_extract_method (struct EXTRACTOR_ExtractContext *ec)
uint32_t chunksize;
int ret;

- if (sizeof (struct header) >
+ if ((ssize_t) sizeof (struct header) >
ec->read (ec->cls,
&data,
sizeof (struct header)))
--- a/src/plugins/s3m_extractor.c
+++ b/src/plugins/s3m_extractor.c
@@ -80,7 +80,7 @@ EXTRACTOR_s3m_extract_method (struct EXTRACTOR_ExtractContext *ec)
struct S3MHeader header;
char song_name_NT[29];

- if (sizeof (header) >
+ if ((ssize_t) sizeof (header) >
ec->read (ec->cls,
&data,
sizeof (header)))
--- a/src/plugins/sid_extractor.c
+++ b/src/plugins/sid_extractor.c
@@ -176,7 +176,7 @@ EXTRACTOR_sid_extract_method (struct EXTRACTOR_ExtractContext *ec)
const struct header *head;
void *data;

- if (sizeof (struct header) >
+ if ((ssize_t) sizeof (struct header) >
ec->read (ec->cls,
&data,
sizeof (struct header)))
--- a/src/plugins/xm_extractor.c
+++ b/src/plugins/xm_extractor.c
@@ -70,7 +70,7 @@ EXTRACTOR_xm_extract_method (struct EXTRACTOR_ExtractContext *ec)
char xmversion[8];
size_t n;

- if (sizeof (struct Header) >
+ if ((ssize_t) sizeof (struct Header) >
ec->read (ec->cls,
&data,
sizeof (struct Header)))
--
cgit v1.1
2 changes: 2 additions & 0 deletions media-libs/libextractor/libextractor-1.6.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ RDEPEND="${COMMON_DEPEND}
!sci-biology/glimmer
"

PATCHES=( "${FILESDIR}/${P}-CVE-2017-17440.patch" )

src_prepare() {
default

Expand Down

0 comments on commit 6859a8b

Please sign in to comment.