Fix CVE-2017-8362: https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-8362 Patch copied from upstream source repository: https://github.com/erikd/libsndfile/commit/ef1dbb2df1c0e741486646de40bd638a9c4cd808 From ef1dbb2df1c0e741486646de40bd638a9c4cd808 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Fri, 14 Apr 2017 15:19:16 +1000 Subject: [PATCH] src/flac.c: Fix a buffer read overflow 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(-) diff --git a/src/flac.c b/src/flac.c index 5a4f8c21..e4f9aaa0 100644 --- 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) @@ -436,7 +443,7 @@ sf_flac_meta_callback (const FLAC__StreamDecoder * UNUSED (decoder), const FLAC_ { 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 ; -- 2.12.2 c85d51f082681a9f4fa911867afba'>opam.scm
AgeCommit message (Expand)Author
2024-04-15utils: Don’t re-export ‘call-with-temporary-output-file’....Ludovic Courtès
2023-05-31tests: Use quasiquoted 'match' patterns for package sexps....Ludovic Courtès
2021-11-18tests: Adjust opam and pypi tests to simplified inputs....Ludovic Courtès
2021-10-12Merge remote-tracking branch 'origin/master' into core-updates-frozen.Mathieu Othacehe
2021-09-18tests: Allow opam test to run without networking....Ludovic Courtès
2021-09-07Merge branch 'master' into core-updates-frozenLudovic Courtès
2021-08-21guix: opam: More flexibility in the importer....Alice BRENON
2021-07-20import: opam: Emit new-style package inputs....Sarah Morgensen
2021-05-28import: opam: Generate license for package....Xinglu Chen
2020-12-08import: opam: Adjust test to latest 'opam->guix-package' changes....Ludovic Courtès
2020-12-08guix: opam: Pass default repository to recursive importer....Julien Lepiller
2020-10-02tests: opam: Test additional syntax....Julien Lepiller
2020-10-02tests: opam: Factorize tests....Julien Lepiller
2020-01-17import: opam: Avoid uses of '@@' in tests....Ludovic Courtès