diff options
author | Predrag Ivanovic <predivan@mts.rs> | 2017-08-31 16:14:55 +0200 |
---|---|---|
committer | Danny Rawlins <monster.romster@gmail.com> | 2017-10-12 23:31:35 +1100 |
commit | 9a5849cf67570fc03a24dddf79a60727ab6c0094 (patch) | |
tree | 85a2bc846ba82d3a6ad793f4cf499a55db8b7cfe /libsndfile/0002-src-flac.c-Fix-a-buffer-read-overflow.patch | |
parent | ad7104e4ae9176be36bd83280a27aace930d5177 (diff) | |
download | opt-9a5849cf67570fc03a24dddf79a60727ab6c0094.tar.gz opt-9a5849cf67570fc03a24dddf79a60727ab6c0094.tar.xz |
libsndfile: Update to 1.0.28, fix CVE-2017-12562
Fix heap buffer overflows when writing strings in binheader
Add to-be-upstreamed patches from openSUSE:
0001-FLAC-Fix-a-buffer-read-overrun.patch
0002-src-flac.c-Fix-a-buffer-read-overflow.patch
0010-src-aiff.c-Fix-a-buffer-read-overflow.patch
Ref:
RH bug: https://bugzilla.redhat.com/show_bug.cgi?id=1483140
Upstream Github issue: https://github.com/erikd/libsndfile/issues/292
Upstream CVE-2017-12562 patch commit: https://github.com/erikd/libsndfile/commit/cf7a8182c2642c50f1cf90dddea9ce96a8bad2e8
Diffstat (limited to 'libsndfile/0002-src-flac.c-Fix-a-buffer-read-overflow.patch')
-rw-r--r-- | libsndfile/0002-src-flac.c-Fix-a-buffer-read-overflow.patch | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/libsndfile/0002-src-flac.c-Fix-a-buffer-read-overflow.patch b/libsndfile/0002-src-flac.c-Fix-a-buffer-read-overflow.patch new file mode 100644 index 000000000..1ed74de03 --- /dev/null +++ b/libsndfile/0002-src-flac.c-Fix-a-buffer-read-overflow.patch @@ -0,0 +1,50 @@ +From ef1dbb2df1c0e741486646de40bd638a9c4cd808 Mon Sep 17 00:00:00 2001 +From: Erik de Castro Lopo <erikd@mega-nerd.com> +Date: Fri, 14 Apr 2017 15:19:16 +1000 +Subject: [PATCH] src/flac.c: Fix a buffer read overflow +References: CVE-2017-8362 bsc#1036943 + +A file (generated by a fuzzer) which increased the number of channels +from one frame to the next could cause a read beyond the end of the +buffer provided by libFLAC. Only option is to abort the read. + +Closes: https://github.com/erikd/libsndfile/issues/231 + +--- + src/flac.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +--- a/src/flac.c ++++ b/src/flac.c +@@ -169,6 +169,14 @@ flac_buffer_copy (SF_PRIVATE *psf) + const int32_t* const *buffer = pflac->wbuffer ; + unsigned i = 0, j, offset, channels, len ; + ++ if (psf->sf.channels != (int) frame->header.channels) ++ { psf_log_printf (psf, "Error: FLAC frame changed from %d to %d channels\n" ++ "Nothing to do but to error out.\n" , ++ psf->sf.channels, frame->header.channels) ; ++ psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ; ++ return 0 ; ++ } ; ++ + /* + ** frame->header.blocksize is variable and we're using a constant blocksize + ** of FLAC__MAX_BLOCK_SIZE. +@@ -202,7 +210,6 @@ flac_buffer_copy (SF_PRIVATE *psf) + return 0 ; + } ; + +- + len = SF_MIN (pflac->len, frame->header.blocksize) ; + + if (pflac->remain % channels != 0) +@@ -437,7 +444,7 @@ sf_flac_meta_callback (const FLAC__Strea + { case FLAC__METADATA_TYPE_STREAMINFO : + if (psf->sf.channels > 0 && psf->sf.channels != (int) metadata->data.stream_info.channels) + { psf_log_printf (psf, "Error: FLAC stream changed from %d to %d channels\n" +- "Nothing to be but to error out.\n" , ++ "Nothing to do but to error out.\n" , + psf->sf.channels, metadata->data.stream_info.channels) ; + psf->error = SFE_FLAC_CHANNEL_COUNT_CHANGED ; + return ; |