From e85cfee3b5c6657a12761677c96d1506683c925b Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Dec 15 2018 01:16:06 +0000 Subject: Fix double-free in CEmuopl::~CEmuopl() (#1635881, CVE-2018-17825) --- diff --git a/adplug-2.3.1-cve-2018-17825.patch b/adplug-2.3.1-cve-2018-17825.patch new file mode 100644 index 0000000..bbf7701 --- /dev/null +++ b/adplug-2.3.1-cve-2018-17825.patch @@ -0,0 +1,25 @@ +From 19ebb61bf92262dc1868de10ba5a211db249ce76 Mon Sep 17 00:00:00 2001 +From: Stas'M +Date: Thu, 4 Oct 2018 00:18:32 +0300 +Subject: [PATCH] FMOPL: Avoid double-free by checking OPL pointer (fix #67) + +Fixes CVE-2018-17825. +--- + src/fmopl.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/fmopl.c b/src/fmopl.c +index 0cd1d69..1c4485e 100644 +--- a/src/fmopl.c ++++ b/src/fmopl.c +@@ -1269,6 +1269,10 @@ FM_OPL *OPLCreate(int type, int clock, int rate) + /* ---------- Destroy one of vietual YM3812 ---------- */ + void OPLDestroy(FM_OPL *OPL) + { ++ if(!OPL) ++ { ++ return; ++ } + #ifdef OPL_OUTPUT_LOG + if(opl_dbg_fp) + { diff --git a/adplug.spec b/adplug.spec index 82d34a6..f1d3fb4 100644 --- a/adplug.spec +++ b/adplug.spec @@ -4,13 +4,14 @@ %define adplugdbver 2006-07-07 Name: adplug Version: 2.2.1 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A software library for AdLib (OPL2) emulation URL: http://adplug.github.io/ Group: Applications/Multimedia Source0: http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 Source1: http://download.sourceforge.net/%{name}/adplugdb-%{adplugdbver}.tar.gz Patch0: adplug-2.2.1-signed-char.patch +Patch1: adplug-2.3.1-cve-2018-17825.patch License: LGPLv2+ BuildRequires: gcc-c++ BuildRequires: libbinio-devel >= 1.4 @@ -45,6 +46,7 @@ This package contains development files for the AdPlug AdLib %prep %setup -q %patch0 -p1 +%patch1 -p1 tar xvfz %{SOURCE1} # Include these by different name mv %{adplugdbver}/README README.adplugdb @@ -90,6 +92,9 @@ install -p -m 644 %{adplugdbver}/adplug.db $RPM_BUILD_ROOT%{shareddata}/%{name} %{_infodir}/*.gz %changelog +* Sat Dec 15 2018 Robert Scheck - 2.2.1-7 +- Fix double-free in CEmuopl::~CEmuopl() (#1635881, CVE-2018-17825) + * Thu Jul 12 2018 Fedora Release Engineering - 2.2.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild