diff options
| author | Leo <thinkabit.ukim@gmail.com> | 2019-12-23 19:06:02 +0100 |
|---|---|---|
| committer | Leo <thinkabit.ukim@gmail.com> | 2019-12-23 19:21:10 +0100 |
| commit | fcfac0bb84e91ad39d8554e3ff04d2aacc625915 (patch) | |
| tree | 259a62e4098eb6f6098dbb04f325f5fcc7b3ee1f | |
| parent | f5d09b2ae7d02703e8a5b4d3e5b1d8247f476584 (diff) | |
| download | aports-fcfac0bb84e91ad39d8554e3ff04d2aacc625915.tar.bz2 aports-fcfac0bb84e91ad39d8554e3ff04d2aacc625915.tar.xz | |
main/wavpack: upgrade to 5.2.0
| -rw-r--r-- | main/wavpack/APKBUILD | 33 | ||||
| -rw-r--r-- | main/wavpack/CVE-2018-10536_10537.patch | 60 | ||||
| -rw-r--r-- | main/wavpack/CVE-2018-10538_10539_10540.patch | 71 | ||||
| -rw-r--r-- | main/wavpack/CVE-2018-19840.patch | 25 | ||||
| -rw-r--r-- | main/wavpack/CVE-2018-19841.patch | 29 | ||||
| -rw-r--r-- | main/wavpack/CVE-2018-6767.patch | 112 | ||||
| -rw-r--r-- | main/wavpack/CVE-2018-7253.patch | 32 | ||||
| -rw-r--r-- | main/wavpack/CVE-2018-7254.patch | 66 | ||||
| -rw-r--r-- | main/wavpack/CVE-2019-1010315.patch | 36 | ||||
| -rw-r--r-- | main/wavpack/CVE-2019-1010317.patch | 40 | ||||
| -rw-r--r-- | main/wavpack/CVE-2019-1010319.patch | 23 | ||||
| -rw-r--r-- | main/wavpack/CVE-2019-11498.patch | 32 | ||||
| -rw-r--r-- | main/wavpack/iconv-underlinking.patch | 21 |
13 files changed, 4 insertions, 576 deletions
diff --git a/main/wavpack/APKBUILD b/main/wavpack/APKBUILD index 2834c2c550..aca7390935 100644 --- a/main/wavpack/APKBUILD +++ b/main/wavpack/APKBUILD @@ -2,27 +2,15 @@ # Contributor: Carlo Landmeter # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=wavpack -pkgver=5.1.0 -pkgrel=8 +pkgver=5.2.0 +pkgrel=0 pkgdesc="Audio compression format with lossless, lossy, and hybrid compression modes" url="http://www.wavpack.com/" arch="all" options="!check" # No test suite. license="BSD-3-Clause" subpackages="$pkgname-dev $pkgname-doc" -source="http://www.wavpack.com/wavpack-$pkgver.tar.bz2 - CVE-2018-6767.patch - CVE-2018-7253.patch - CVE-2018-7254.patch - CVE-2018-10536_10537.patch - CVE-2018-10538_10539_10540.patch - CVE-2018-19840.patch - CVE-2018-19841.patch - CVE-2019-1010315.patch - CVE-2019-11498.patch - CVE-2019-1010317.patch - CVE-2019-1010319.patch - " +source="http://www.wavpack.com/wavpack-$pkgver.tar.xz" # secfixes: # 5.1.0-r8: @@ -50,7 +38,6 @@ source="http://www.wavpack.com/wavpack-$pkgver.tar.bz2 # - CVE-2016-10172 build() { - cd "$builddir" ./configure \ --build=$CBUILD \ --host=$CHOST \ @@ -63,19 +50,7 @@ build() { } package() { - cd "$builddir" make DESTDIR="$pkgdir" install } -sha512sums="4c31616ae63c3a875afa20f26ce935f7a8f9921e2892b4b8388eca3ccd83b2d686f43eed8b9ec1dead934a1148401b9dced3b05f509b7942c48d7af31cf80a54 wavpack-5.1.0.tar.bz2 -9a4d0da20398c3500f2308abae921bda2149e46270e0424b83b06bf9a15ff16b5b89c000a7633a6b454f09f7e2ffd5a88de37cd7504f633108e50c0d954c883c CVE-2018-6767.patch -6e8bdb2a1fa1445de7778226bf4db35efa96f6455be3f2c52bd56dc567eba8eeba9a0140965816c2dc340abcdcb966dc6fd647345e419fde3dceba2a512e5395 CVE-2018-7253.patch -8745e1d3b97df6bdc2844c6731c1079afce8aee6cd3ad39557c8442687f80d2e2b278fd5277e35f7793de3035a7923be69a248dd7ab2cae66d92ea43905dae60 CVE-2018-7254.patch -fd7ff58c53f9b4cec335e36017c5b1709c5526a2d44a54dfbeb050ea303997418d1fa312ebe39f521a35a6f2151b8a0f5845ee9bf6bbda22bef036e9fc0166a5 CVE-2018-10536_10537.patch -a59eff2a8f47d4383f33667e7737f5e2e639778b367340169f1c5d6335c8948cfd8e1a7554e8b6c05a59d80a04048cf137c0f4fdfd88d2d88757404d3dac31ee CVE-2018-10538_10539_10540.patch -67d02dd744c638d126cf5a894d1ff2c39726bd4d3771ef7410ea782e5c9a0f9341909432bd4bea9b8959891c38699601c1aac2da6e0eaddaa5a4d679e7f58dd2 CVE-2018-19840.patch -dba007fa8cb2537b6f6c8ee559a98e501e948260ce7e7af7d3fdc8c9145bbbbf85c8fed8030de354459c4b08d3015a0ea769a948636bdfd66e567c0a2d2493c6 CVE-2018-19841.patch -46d0fb4483e5ea824b1bce67f2ea76894e16b3f86cd28f234c1e393ea1d859ac304f44f22a7e32cdfbd83ff83d99fc147e0f9de932ee674c4f565cc92e279c28 CVE-2019-1010315.patch -30ad915f481eef07737cb95e44c1988441b72d0fc6731c4e48b391deb44168ad7536e0e7c3c9363e18f27814cade4c784e9a61e6a46e103aa88db0b42cef57e3 CVE-2019-11498.patch -91b0fdefdfe2a3f135f3fdf947b43a7bc347e4cd21804d0e4997066997a32bc9bb218cc2ef6b1733c011d83c22035efd22cf993b7af5d0fa540441a3e9685c3c CVE-2019-1010317.patch -a180c662d41e96913b946782ae4679b944029d0d62161a7fc204c0b2ff898409a375a33d2376885fe425c449128de61f161867d1c264120682c0708aeea2d21e CVE-2019-1010319.patch" +sha512sums="f255bb62c9defb16c1b301fd1cfb53df123c869a74eca2b68f1c8af2771e22ff8661f823ad4bd2746d06c0941a3cb83a6dbb55b44b371fc50d0ecdf80a5199c2 wavpack-5.2.0.tar.xz" diff --git a/main/wavpack/CVE-2018-10536_10537.patch b/main/wavpack/CVE-2018-10536_10537.patch deleted file mode 100644 index 972df4b912..0000000000 --- a/main/wavpack/CVE-2018-10536_10537.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 26cb47f99d481ad9b93eeff80d26e6b63bbd7e15 Mon Sep 17 00:00:00 2001 -From: David Bryant <david@wavpack.com> -Date: Tue, 24 Apr 2018 22:18:07 -0700 -Subject: [PATCH] issue #30 issue #31 issue #32: no multiple format chunks in - WAV or W64 - ---- - cli/riff.c | 7 ++++++- - cli/wave64.c | 6 ++++++ - 2 files changed, 12 insertions(+), 1 deletion(-) - -diff --git a/cli/riff.c b/cli/riff.c -index 7bddf63..5d6452e 100644 ---- a/cli/riff.c -+++ b/cli/riff.c -@@ -53,7 +53,7 @@ extern int debug_logging_mode; - - int ParseRiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config) - { -- int is_rf64 = !strncmp (fourcc, "RF64", 4), got_ds64 = 0; -+ int is_rf64 = !strncmp (fourcc, "RF64", 4), got_ds64 = 0, format_chunk = 0; - int64_t total_samples = 0, infilesize; - RiffChunkHeader riff_chunk_header; - ChunkHeader chunk_header; -@@ -140,6 +140,11 @@ int ParseRiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack - else if (!strncmp (chunk_header.ckID, "fmt ", 4)) { // if it's the format chunk, we want to get some info out of there and - int supported = TRUE, format; // make sure it's a .wav file we can handle - -+ if (format_chunk++) { -+ error_line ("%s is not a valid .WAV file!", infilename); -+ return WAVPACK_SOFT_ERROR; -+ } -+ - if (chunk_header.ckSize < 16 || chunk_header.ckSize > sizeof (WaveHeader) || - !DoReadFile (infile, &WaveHeader, chunk_header.ckSize, &bcount) || - bcount != chunk_header.ckSize) { -diff --git a/cli/wave64.c b/cli/wave64.c -index fa928a0..0388dc7 100644 ---- a/cli/wave64.c -+++ b/cli/wave64.c -@@ -53,6 +53,7 @@ int ParseWave64HeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa - Wave64ChunkHeader chunk_header; - Wave64FileHeader filehdr; - WaveHeader WaveHeader; -+ int format_chunk = 0; - uint32_t bcount; - - infilesize = DoGetFileSize (infile); -@@ -104,6 +105,11 @@ int ParseWave64HeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa - if (!memcmp (chunk_header.ckID, fmt_guid, sizeof (fmt_guid))) { - int supported = TRUE, format; - -+ if (format_chunk++) { -+ error_line ("%s is not a valid .W64 file!", infilename); -+ return WAVPACK_SOFT_ERROR; -+ } -+ - chunk_header.ckSize = (chunk_header.ckSize + 7) & ~7L; - - if (chunk_header.ckSize < 16 || chunk_header.ckSize > sizeof (WaveHeader) || diff --git a/main/wavpack/CVE-2018-10538_10539_10540.patch b/main/wavpack/CVE-2018-10538_10539_10540.patch deleted file mode 100644 index f037831355..0000000000 --- a/main/wavpack/CVE-2018-10538_10539_10540.patch +++ /dev/null @@ -1,71 +0,0 @@ -From 6f8bb34c2993a48ab9afbe353e6d0cff7c8d821d Mon Sep 17 00:00:00 2001 -From: David Bryant <david@wavpack.com> -Date: Tue, 24 Apr 2018 17:27:01 -0700 -Subject: [PATCH] issue #33, sanitize size of unknown chunks before malloc() - ---- - cli/dsdiff.c | 9 ++++++++- - cli/riff.c | 9 ++++++++- - cli/wave64.c | 9 ++++++++- - 3 files changed, 24 insertions(+), 3 deletions(-) - -diff --git a/cli/dsdiff.c b/cli/dsdiff.c -index c016df9..fa56bbb 100644 ---- a/cli/dsdiff.c -+++ b/cli/dsdiff.c -@@ -279,7 +279,14 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa - else { // just copy unknown chunks to output file - - int bytes_to_copy = (int)(((dff_chunk_header.ckDataSize) + 1) & ~(int64_t)1); -- char *buff = malloc (bytes_to_copy); -+ char *buff; -+ -+ if (bytes_to_copy < 0 || bytes_to_copy > 4194304) { -+ error_line ("%s is not a valid .DFF file!", infilename); -+ return WAVPACK_SOFT_ERROR; -+ } -+ -+ buff = malloc (bytes_to_copy); - - if (debug_logging_mode) - error_line ("extra unknown chunk \"%c%c%c%c\" of %d bytes", -diff --git a/cli/riff.c b/cli/riff.c -index de98c1e..7bddf63 100644 ---- a/cli/riff.c -+++ b/cli/riff.c -@@ -286,7 +286,14 @@ int ParseRiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack - else { // just copy unknown chunks to output file - - int bytes_to_copy = (chunk_header.ckSize + 1) & ~1L; -- char *buff = malloc (bytes_to_copy); -+ char *buff; -+ -+ if (bytes_to_copy < 0 || bytes_to_copy > 4194304) { -+ error_line ("%s is not a valid .WAV file!", infilename); -+ return WAVPACK_SOFT_ERROR; -+ } -+ -+ buff = malloc (bytes_to_copy); - - if (debug_logging_mode) - error_line ("extra unknown chunk \"%c%c%c%c\" of %d bytes", -diff --git a/cli/wave64.c b/cli/wave64.c -index 591d640..fa928a0 100644 ---- a/cli/wave64.c -+++ b/cli/wave64.c -@@ -241,7 +241,14 @@ int ParseWave64HeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa - } - else { // just copy unknown chunks to output file - int bytes_to_copy = (chunk_header.ckSize + 7) & ~7L; -- char *buff = malloc (bytes_to_copy); -+ char *buff; -+ -+ if (bytes_to_copy < 0 || bytes_to_copy > 4194304) { -+ error_line ("%s is not a valid .W64 file!", infilename); -+ return WAVPACK_SOFT_ERROR; -+ } -+ -+ buff = malloc (bytes_to_copy); - - if (debug_logging_mode) - error_line ("extra unknown chunk \"%c%c%c%c\" of %d bytes", diff --git a/main/wavpack/CVE-2018-19840.patch b/main/wavpack/CVE-2018-19840.patch deleted file mode 100644 index 2da0220258..0000000000 --- a/main/wavpack/CVE-2018-19840.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 070ef6f138956d9ea9612e69586152339dbefe51 Mon Sep 17 00:00:00 2001 -From: David Bryant <david@wavpack.com> -Date: Thu, 29 Nov 2018 21:00:42 -0800 -Subject: [PATCH] issue #53: error out on zero sample rate - ---- - src/pack_utils.c | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/pack_utils.c b/src/pack_utils.c -index 2253f0d..2a83497 100644 ---- a/src/pack_utils.c -+++ b/src/pack_utils.c -@@ -195,6 +195,11 @@ int WavpackSetConfiguration64 (WavpackContext *wpc, WavpackConfig *config, int64 - int num_chans = config->num_channels; - int i; - -+ if (!config->sample_rate) { -+ strcpy (wpc->error_message, "sample rate cannot be zero!"); -+ return FALSE; -+ } -+ - wpc->stream_version = (config->flags & CONFIG_COMPATIBLE_WRITE) ? CUR_STREAM_VERS : MAX_STREAM_VERS; - - if ((config->qmode & QMODE_DSD_AUDIO) && config->bytes_per_sample == 1 && config->bits_per_sample == 8) { diff --git a/main/wavpack/CVE-2018-19841.patch b/main/wavpack/CVE-2018-19841.patch deleted file mode 100644 index 6872ed91e4..0000000000 --- a/main/wavpack/CVE-2018-19841.patch +++ /dev/null @@ -1,29 +0,0 @@ -From bba5389dc598a92bdf2b297c3ea34620b6679b5b Mon Sep 17 00:00:00 2001 -From: David Bryant <david@wavpack.com> -Date: Thu, 29 Nov 2018 21:53:51 -0800 -Subject: [PATCH] issue #54: fix potential out-of-bounds heap read - ---- - src/open_utils.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/open_utils.c b/src/open_utils.c -index 80051fc..4fe0d67 100644 ---- a/src/open_utils.c -+++ b/src/open_utils.c -@@ -1258,13 +1258,13 @@ int WavpackVerifySingleBlock (unsigned char *buffer, int verify_checksum) - #endif - - if (meta_bc == 4) { -- if (*dp++ != (csum & 0xff) || *dp++ != ((csum >> 8) & 0xff) || *dp++ != ((csum >> 16) & 0xff) || *dp++ != ((csum >> 24) & 0xff)) -+ if (*dp != (csum & 0xff) || dp[1] != ((csum >> 8) & 0xff) || dp[2] != ((csum >> 16) & 0xff) || dp[3] != ((csum >> 24) & 0xff)) - return FALSE; - } - else { - csum ^= csum >> 16; - -- if (*dp++ != (csum & 0xff) || *dp++ != ((csum >> 8) & 0xff)) -+ if (*dp != (csum & 0xff) || dp[1] != ((csum >> 8) & 0xff)) - return FALSE; - } - diff --git a/main/wavpack/CVE-2018-6767.patch b/main/wavpack/CVE-2018-6767.patch deleted file mode 100644 index 24e159f4e3..0000000000 --- a/main/wavpack/CVE-2018-6767.patch +++ /dev/null @@ -1,112 +0,0 @@ -From d5bf76b5a88d044a1be1d5656698e3ba737167e5 Mon Sep 17 00:00:00 2001 -From: David Bryant <david@wavpack.com> -Date: Sun, 4 Feb 2018 11:28:15 -0800 -Subject: [PATCH] issue #27, do not overwrite stack on corrupt RF64 file - ---- - cli/riff.c | 39 ++++++++++++++++++++++++++++++++------- - 1 file changed, 32 insertions(+), 7 deletions(-) - -diff --git a/cli/riff.c b/cli/riff.c -index 8b1af45..de98c1e 100644 ---- a/cli/riff.c -+++ b/cli/riff.c -@@ -42,6 +42,7 @@ typedef struct { - - #pragma pack(pop) - -+#define CS64ChunkFormat "4D" - #define DS64ChunkFormat "DDDL" - - #define WAVPACK_NO_ERROR 0 -@@ -101,13 +102,13 @@ int ParseRiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack - - if (!strncmp (chunk_header.ckID, "ds64", 4)) { - if (chunk_header.ckSize < sizeof (DS64Chunk) || -- !DoReadFile (infile, &ds64_chunk, chunk_header.ckSize, &bcount) || -- bcount != chunk_header.ckSize) { -+ !DoReadFile (infile, &ds64_chunk, sizeof (DS64Chunk), &bcount) || -+ bcount != sizeof (DS64Chunk)) { - error_line ("%s is not a valid .WAV file!", infilename); - return WAVPACK_SOFT_ERROR; - } - else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) && -- !WavpackAddWrapper (wpc, &ds64_chunk, chunk_header.ckSize)) { -+ !WavpackAddWrapper (wpc, &ds64_chunk, sizeof (DS64Chunk))) { - error_line ("%s", WavpackGetErrorMessage (wpc)); - return WAVPACK_SOFT_ERROR; - } -@@ -315,10 +316,11 @@ int ParseRiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack - - int WriteRiffHeader (FILE *outfile, WavpackContext *wpc, int64_t total_samples, int qmode) - { -- int do_rf64 = 0, write_junk = 1; -+ int do_rf64 = 0, write_junk = 1, table_length = 0; - ChunkHeader ds64hdr, datahdr, fmthdr; - RiffChunkHeader riffhdr; - DS64Chunk ds64_chunk; -+ CS64Chunk cs64_chunk; - JunkChunk junkchunk; - WaveHeader wavhdr; - uint32_t bcount; -@@ -380,6 +382,7 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wpc, int64_t total_samples, - strncpy (riffhdr.formType, "WAVE", sizeof (riffhdr.formType)); - total_riff_bytes = sizeof (riffhdr) + wavhdrsize + sizeof (datahdr) + ((total_data_bytes + 1) & ~(int64_t)1); - if (do_rf64) total_riff_bytes += sizeof (ds64hdr) + sizeof (ds64_chunk); -+ total_riff_bytes += table_length * sizeof (CS64Chunk); - if (write_junk) total_riff_bytes += sizeof (junkchunk); - strncpy (fmthdr.ckID, "fmt ", sizeof (fmthdr.ckID)); - strncpy (datahdr.ckID, "data", sizeof (datahdr.ckID)); -@@ -394,11 +397,12 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wpc, int64_t total_samples, - - if (do_rf64) { - strncpy (ds64hdr.ckID, "ds64", sizeof (ds64hdr.ckID)); -- ds64hdr.ckSize = sizeof (ds64_chunk); -+ ds64hdr.ckSize = sizeof (ds64_chunk) + (table_length * sizeof (CS64Chunk)); - CLEAR (ds64_chunk); - ds64_chunk.riffSize64 = total_riff_bytes; - ds64_chunk.dataSize64 = total_data_bytes; - ds64_chunk.sampleCount64 = total_samples; -+ ds64_chunk.tableLength = table_length; - riffhdr.ckSize = (uint32_t) -1; - datahdr.ckSize = (uint32_t) -1; - WavpackNativeToLittleEndian (&ds64hdr, ChunkHeaderFormat); -@@ -409,6 +413,14 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wpc, int64_t total_samples, - datahdr.ckSize = (uint32_t) total_data_bytes; - } - -+ // this "table" is just a dummy placeholder for testing (normally not written) -+ -+ if (table_length) { -+ strncpy (cs64_chunk.ckID, "dmmy", sizeof (cs64_chunk.ckID)); -+ cs64_chunk.chunkSize64 = 12345678; -+ WavpackNativeToLittleEndian (&cs64_chunk, CS64ChunkFormat); -+ } -+ - // write the RIFF chunks up to just before the data starts - - WavpackNativeToLittleEndian (&riffhdr, ChunkHeaderFormat); -@@ -418,8 +430,21 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wpc, int64_t total_samples, - - if (!DoWriteFile (outfile, &riffhdr, sizeof (riffhdr), &bcount) || bcount != sizeof (riffhdr) || - (do_rf64 && (!DoWriteFile (outfile, &ds64hdr, sizeof (ds64hdr), &bcount) || bcount != sizeof (ds64hdr))) || -- (do_rf64 && (!DoWriteFile (outfile, &ds64_chunk, sizeof (ds64_chunk), &bcount) || bcount != sizeof (ds64_chunk))) || -- (write_junk && (!DoWriteFile (outfile, &junkchunk, sizeof (junkchunk), &bcount) || bcount != sizeof (junkchunk))) || -+ (do_rf64 && (!DoWriteFile (outfile, &ds64_chunk, sizeof (ds64_chunk), &bcount) || bcount != sizeof (ds64_chunk)))) { -+ error_line ("can't write .WAV data, disk probably full!"); -+ return FALSE; -+ } -+ -+ // again, this is normally not written except for testing -+ -+ while (table_length--) -+ if (!DoWriteFile (outfile, &cs64_chunk, sizeof (cs64_chunk), &bcount) || bcount != sizeof (cs64_chunk)) { -+ error_line ("can't write .WAV data, disk probably full!"); -+ return FALSE; -+ } -+ -+ -+ if ((write_junk && (!DoWriteFile (outfile, &junkchunk, sizeof (junkchunk), &bcount) || bcount != sizeof (junkchunk))) || - !DoWriteFile (outfile, &fmthdr, sizeof (fmthdr), &bcount) || bcount != sizeof (fmthdr) || - !DoWriteFile (outfile, &wavhdr, wavhdrsize, &bcount) || bcount != wavhdrsize || - !DoWriteFile (outfile, &datahdr, sizeof (datahdr), &bcount) || bcount != sizeof (datahdr)) { diff --git a/main/wavpack/CVE-2018-7253.patch b/main/wavpack/CVE-2018-7253.patch deleted file mode 100644 index 35b9b2e120..0000000000 --- a/main/wavpack/CVE-2018-7253.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 36a24c7881427d2e1e4dc1cef58f19eee0d13aec Mon Sep 17 00:00:00 2001 -From: David Bryant <david@wavpack.com> -Date: Sat, 10 Feb 2018 16:01:39 -0800 -Subject: [PATCH] issue #28, do not overwrite heap on corrupt DSDIFF file - ---- - cli/dsdiff.c | 12 +++++++++++- - 1 file changed, 11 insertions(+), 1 deletion(-) - -diff --git a/cli/dsdiff.c b/cli/dsdiff.c -index 410dc1c..c016df9 100644 ---- a/cli/dsdiff.c -+++ b/cli/dsdiff.c -@@ -153,7 +153,17 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa - error_line ("dsdiff file version = 0x%08x", version); - } - else if (!strncmp (dff_chunk_header.ckID, "PROP", 4)) { -- char *prop_chunk = malloc ((size_t) dff_chunk_header.ckDataSize); -+ char *prop_chunk; -+ -+ if (dff_chunk_header.ckDataSize < 4 || dff_chunk_header.ckDataSize > 1024) { -+ error_line ("%s is not a valid .DFF file!", infilename); -+ return WAVPACK_SOFT_ERROR; -+ } -+ -+ if (debug_logging_mode) -+ error_line ("got PROP chunk of %d bytes total", (int) dff_chunk_header.ckDataSize); -+ -+ prop_chunk = malloc ((size_t) dff_chunk_header.ckDataSize); - - if (!DoReadFile (infile, prop_chunk, (uint32_t) dff_chunk_header.ckDataSize, &bcount) || - bcount != dff_chunk_header.ckDataSize) { diff --git a/main/wavpack/CVE-2018-7254.patch b/main/wavpack/CVE-2018-7254.patch deleted file mode 100644 index 6c708b8661..0000000000 --- a/main/wavpack/CVE-2018-7254.patch +++ /dev/null @@ -1,66 +0,0 @@ -From 8e3fe45a7bac31d9a3b558ae0079e2d92a04799e Mon Sep 17 00:00:00 2001 -From: David Bryant <david@wavpack.com> -Date: Sun, 11 Feb 2018 16:37:47 -0800 -Subject: [PATCH] issue #28, fix buffer overflows and bad allocs on corrupt CAF - files - ---- - cli/caff.c | 30 +++++++++++++++++++++++------- - 1 file changed, 23 insertions(+), 7 deletions(-) - -diff --git a/cli/caff.c b/cli/caff.c -index ae57c4b..6248a71 100644 ---- a/cli/caff.c -+++ b/cli/caff.c -@@ -89,8 +89,8 @@ typedef struct - - #define CAFChannelDescriptionFormat "LLLLL" - --static const char TMH_full [] = { 1,2,3,13,9,10,5,6,12,14,15,16,17,9,4,18,7,8,19,20,21 }; --static const char TMH_std [] = { 1,2,3,11,8,9,5,6,10,12,13,14,15,7,4,16 }; -+static const char TMH_full [] = { 1,2,3,13,9,10,5,6,12,14,15,16,17,9,4,18,7,8,19,20,21,0 }; -+static const char TMH_std [] = { 1,2,3,11,8,9,5,6,10,12,13,14,15,7,4,16,0 }; - - static struct { - uint32_t mChannelLayoutTag; // Core Audio layout, 100 - 146 in high word, num channels in low word -@@ -274,10 +274,19 @@ int ParseCaffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack - } - } - else if (!strncmp (caf_chunk_header.mChunkType, "chan", 4)) { -- CAFChannelLayout *caf_channel_layout = malloc ((size_t) caf_chunk_header.mChunkSize); -+ CAFChannelLayout *caf_channel_layout; - -- if (caf_chunk_header.mChunkSize < sizeof (CAFChannelLayout) || -- !DoReadFile (infile, caf_channel_layout, (uint32_t) caf_chunk_header.mChunkSize, &bcount) || -+ if (caf_chunk_header.mChunkSize < sizeof (CAFChannelLayout) || caf_chunk_header.mChunkSize > 1024) { -+ error_line ("this .CAF file has an invalid 'chan' chunk!"); -+ return WAVPACK_SOFT_ERROR; -+ } -+ -+ if (debug_logging_mode) -+ error_line ("'chan' chunk is %d bytes", (int) caf_chunk_header.mChunkSize); -+ -+ caf_channel_layout = malloc ((size_t) caf_chunk_header.mChunkSize); -+ -+ if (!DoReadFile (infile, caf_channel_layout, (uint32_t) caf_chunk_header.mChunkSize, &bcount) || - bcount != caf_chunk_header.mChunkSize) { - error_line ("%s is not a valid .CAF file!", infilename); - free (caf_channel_layout); -@@ -495,8 +504,15 @@ int ParseCaffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack - } - else { // just copy unknown chunks to output file - -- int bytes_to_copy = (uint32_t) caf_chunk_header.mChunkSize; -- char *buff = malloc (bytes_to_copy); -+ uint32_t bytes_to_copy = (uint32_t) caf_chunk_header.mChunkSize; -+ char *buff; -+ -+ if (caf_chunk_header.mChunkSize < 0 || caf_chunk_header.mChunkSize > 1048576) { -+ error_line ("%s is not a valid .CAF file!", infilename); -+ return WAVPACK_SOFT_ERROR; -+ } -+ -+ buff = malloc (bytes_to_copy); - - if (debug_logging_mode) - error_line ("extra unknown chunk \"%c%c%c%c\" of %d bytes", diff --git a/main/wavpack/CVE-2019-1010315.patch b/main/wavpack/CVE-2019-1010315.patch deleted file mode 100644 index b52d8884a0..0000000000 --- a/main/wavpack/CVE-2019-1010315.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 4c0faba32fddbd0745cbfaf1e1aeb3da5d35b9fc Mon Sep 17 00:00:00 2001 -From: David Bryant <david@wavpack.com> -Date: Sat, 2 Mar 2019 18:37:14 -0800 -Subject: [PATCH] issue #65: make sure DSDIFF files have a valid channel count - ---- - cli/dsdiff.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/cli/dsdiff.c b/cli/dsdiff.c -index 0ac4321..f357181 100644 ---- a/cli/dsdiff.c -+++ b/cli/dsdiff.c -@@ -180,7 +180,7 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa - - if (!strncmp (prop_chunk, "SND ", 4)) { - char *cptr = prop_chunk + 4, *eptr = prop_chunk + dff_chunk_header.ckDataSize; -- uint16_t numChannels, chansSpecified, chanMask = 0; -+ uint16_t numChannels = 0, chansSpecified, chanMask = 0; - uint32_t sampleRate; - - while (eptr - cptr >= sizeof (dff_chunk_header)) { -@@ -279,6 +279,12 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa - free (prop_chunk); - } - else if (!strncmp (dff_chunk_header.ckID, "DSD ", 4)) { -+ -+ if (!config->num_channels) { -+ error_line ("%s is not a valid .DFF file!", infilename); -+ return WAVPACK_SOFT_ERROR; -+ } -+ - total_samples = dff_chunk_header.ckDataSize / config->num_channels; - break; - } - diff --git a/main/wavpack/CVE-2019-1010317.patch b/main/wavpack/CVE-2019-1010317.patch deleted file mode 100644 index 94f90275b8..0000000000 --- a/main/wavpack/CVE-2019-1010317.patch +++ /dev/null @@ -1,40 +0,0 @@ -From f68a9555b548306c5b1ee45199ccdc4a16a6101b Mon Sep 17 00:00:00 2001 -From: David Bryant <david@wavpack.com> -Date: Mon, 4 Mar 2019 21:09:41 -0800 -Subject: [PATCH] issue #66: make sure CAF files have a "desc" chunk - ---- - cli/caff.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/cli/caff.c b/cli/caff.c -index 2a5e2d9..a35da74 100644 ---- a/cli/caff.c -+++ b/cli/caff.c -@@ -152,7 +152,7 @@ static struct { - - int ParseCaffHeaderConfig (FILE *infile, char *infilename, char *fourcc, WavpackContext *wpc, WavpackConfig *config) - { -- uint32_t chan_chunk = 0, channel_layout = 0, bcount; -+ uint32_t chan_chunk = 0, desc_chunk = 0, channel_layout = 0, bcount; - unsigned char *channel_identities = NULL; - unsigned char *channel_reorder = NULL; - int64_t total_samples = 0, infilesize; -@@ -218,6 +218,7 @@ int ParseCaffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack - } - - WavpackBigEndianToNative (&caf_audio_format, CAFAudioFormatFormat); -+ desc_chunk = 1; - - if (debug_logging_mode) { - char formatstr [5]; -@@ -458,7 +459,7 @@ int ParseCaffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack - else if (!strncmp (caf_chunk_header.mChunkType, "data", 4)) { // on the data chunk, get size and exit loop - uint32_t mEditCount; - -- if (!DoReadFile (infile, &mEditCount, sizeof (mEditCount), &bcount) || -+ if (!desc_chunk || !DoReadFile (infile, &mEditCount, sizeof (mEditCount), &bcount) || - bcount != sizeof (mEditCount)) { - error_line ("%s is not a valid .CAF file!", infilename); - return WAVPACK_SOFT_ERROR; - diff --git a/main/wavpack/CVE-2019-1010319.patch b/main/wavpack/CVE-2019-1010319.patch deleted file mode 100644 index 6a53ef8fbb..0000000000 --- a/main/wavpack/CVE-2019-1010319.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 33a0025d1d63ccd05d9dbaa6923d52b1446a62fe Mon Sep 17 00:00:00 2001 -From: David Bryant <david@wavpack.com> -Date: Tue, 5 Mar 2019 21:21:48 -0800 -Subject: [PATCH] issue #68: clear WaveHeader at start to prevent uninitialized - read - ---- - cli/wave64.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/cli/wave64.c b/cli/wave64.c -index 7beffe6..59548b1 100644 ---- a/cli/wave64.c -+++ b/cli/wave64.c -@@ -56,6 +56,7 @@ int ParseWave64HeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa - int format_chunk = 0; - uint32_t bcount; - -+ CLEAR (WaveHeader); - infilesize = DoGetFileSize (infile); - memcpy (&filehdr, fourcc, 4); - - diff --git a/main/wavpack/CVE-2019-11498.patch b/main/wavpack/CVE-2019-11498.patch deleted file mode 100644 index c94aee1466..0000000000 --- a/main/wavpack/CVE-2019-11498.patch +++ /dev/null @@ -1,32 +0,0 @@ -From bc6cba3f552c44565f7f1e66dc1580189addb2b4 Mon Sep 17 00:00:00 2001 -From: David Bryant <david@wavpack.com> -Date: Tue, 5 Mar 2019 21:32:27 -0800 -Subject: [PATCH] issue #67: make sure sample rate is specified and non-zero in - DFF files - ---- - cli/dsdiff.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/cli/dsdiff.c b/cli/dsdiff.c -index f357181..193adee 100644 ---- a/cli/dsdiff.c -+++ b/cli/dsdiff.c -@@ -181,7 +181,7 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa - if (!strncmp (prop_chunk, "SND ", 4)) { - char *cptr = prop_chunk + 4, *eptr = prop_chunk + dff_chunk_header.ckDataSize; - uint16_t numChannels = 0, chansSpecified, chanMask = 0; -- uint32_t sampleRate; -+ uint32_t sampleRate = 0; - - while (eptr - cptr >= sizeof (dff_chunk_header)) { - memcpy (&dff_chunk_header, cptr, sizeof (dff_chunk_header)); -@@ -280,7 +280,7 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa - } - else if (!strncmp (dff_chunk_header.ckID, "DSD ", 4)) { - -- if (!config->num_channels) { -+ if (!config->num_channels || !config->sample_rate) { - error_line ("%s is not a valid .DFF file!", infilename); - return WAVPACK_SOFT_ERROR; - } diff --git a/main/wavpack/iconv-underlinking.patch b/main/wavpack/iconv-underlinking.patch deleted file mode 100644 index 1d920a1905..0000000000 --- a/main/wavpack/iconv-underlinking.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- ./cli/Makefile.am.orig -+++ ./cli/Makefile.am -@@ -2,15 +2,15 @@ - - wavpack_SOURCES = wavpack.c utils.c md5.c - wavpack_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/include --wavpack_LDADD = $(AM_LDADD) $(top_builddir)/src/.libs/libwavpack.la $(LIBM) -+wavpack_LDADD = $(AM_LDADD) $(top_builddir)/src/.libs/libwavpack.la $(LIBM) $(ICONV_LIBS) - - wvunpack_SOURCES = wvunpack.c utils.c md5.c - wvunpack_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/include --wvunpack_LDADD = $(AM_LDADD) $(top_builddir)/src/.libs/libwavpack.la $(LIBM) -+wvunpack_LDADD = $(AM_LDADD) $(top_builddir)/src/.libs/libwavpack.la $(LIBM) $(ICONV_LIBS) - - wvgain_SOURCES = wvgain.c utils.c - wvgain_CFLAGS = $(AM_CFLAGS) -I$(top_srcdir)/include --wvgain_LDADD = $(AM_LDADD) $(top_builddir)/src/.libs/libwavpack.la $(LIBM) -+wvgain_LDADD = $(AM_LDADD) $(top_builddir)/src/.libs/libwavpack.la $(LIBM) $(ICONV_LIBS) - - noinst_HEADERS = \ - utils.h \ |
