!4 fix memory leak found by fuzz

Merge pull request !4 from ltx/master
This commit is contained in:
openeuler-ci-bot 2020-05-28 20:32:43 +08:00 committed by Gitee
commit 5727e98d8b
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,21 @@
commit cba2f967ebcc7e15d0f33e4219a1e04e2a6fc41e
Author: David Bryant <david@wavpack.com>
Date: Sun Dec 8 12:06:19 2019 -0800
fix possible memory leak on opening corrupted files
diff --git a/src/open_utils.c b/src/open_utils.c
index 170c6eb..dfb7cf6 100644
--- a/src/open_utils.c
+++ b/src/open_utils.c
@@ -177,6 +177,11 @@ WavpackContext *WavpackOpenFileInputEx64 (WavpackStreamReader64 *reader, void *w
return WavpackCloseFile (wpc);
}
+ if (!wps->wphdr.block_samples) { // free blockbuff if we're going to loop again
+ free (wps->blockbuff);
+ wps->blockbuff = NULL;
+ }
+
wps->init_done = TRUE;
}

View File

@ -1,6 +1,6 @@
Name: wavpack
Version: 5.1.0
Release: 11
Release: 12
Summary: Hybrid Lossless Wavefile Compressor
License: BSD
Url: http://www.wavpack.com/
@ -14,6 +14,7 @@ Patch0004: wavpack-0005-issue-30-issue-31-issue-32-no-multiple-format-chunk
Patch0005: wavpack-CVE-2019-11498.patch
# make sure sample rate is specified and non-zero in DFF files
Patch0006: CVE-2018-19841.patch
Patch0007: fix-memory-leak-on-opening-corrupted-files.patch
Patch6000: CVE-2018-19840.patch
BuildRequires: autoconf automake libtool
@ -72,6 +73,12 @@ autoreconf -ivf
%{_mandir}/man1/*.1*
%changelog
* Sat May 14 2020 lutianxiong <lutianxiong@huawei.com> - 5.1.0-12
- Type:bugfix
- ID:NA
- SUG:NA
- Fix memory leak on opening corrupted files
* Sat Mar 14 2020 wangzhishun <wangzhishun1@huawei.com> - 5.1.0-11
- Make sure sample rate is specified and non-zero in DFF files
- Fix potential out-of-bounds heap read