SHA256
1
0
forked from pool/aubio
aubio/aubio-wavread-input-validation.patch
Takashi Iwai a3d4a60444 Accepting request 627873 from home:tiwai:branches:multimedia:libs
- Fix minor security issues leading to segfault or buffer overread
  (CVE-2018-14522, bsc#1102359, CVE-2018-14523, bsc#1102364):
  0001-src-pitch-pitchyinfft.c-fix-out-of-bound-read-when-s.patch
  0002-src-pitch-pitchyinfft.c-comment-out-debug-output.patch
  0001-src-notes-notes.c-bail-out-if-pitch-creation-failed-.patch
  0002-src-io-source_wavread.c-also-exit-if-samplerate-is-n.patch
- Refresh the previous fixes from the upstream version
  aubio-wavread-input-validation.patch
  aubio-resampler-NULL-deref-fix.patch

OBS-URL: https://build.opensuse.org/request/show/627873
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/aubio?expand=0&rev=25
2018-08-07 13:34:56 +00:00

45 lines
1.3 KiB
Diff

From 25ecb7338cebc5b8c79092347839c78349ec33f1 Mon Sep 17 00:00:00 2001
From: Paul Brossier <piem@piem.org>
Date: Tue, 6 Feb 2018 22:32:59 +0100
Subject: [PATCH] src/io/source_wavread.c: add some input validation (closes:
#158)
---
src/io/source_wavread.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/io/source_wavread.c b/src/io/source_wavread.c
index 640201bbbb19..b91eb5cd0f07 100644
--- a/src/io/source_wavread.c
+++ b/src/io/source_wavread.c
@@ -189,6 +189,26 @@ aubio_source_wavread_t * new_aubio_source_wavread(const char_t * path, uint_t sa
// BitsPerSample
bytes_read += fread(buf, 1, 2, s->fid);
bitspersample = read_little_endian(buf, 2);
+
+ if ( channels == 0 ) {
+ AUBIO_ERR("source_wavread: Failed opening %s (number of channels can not be 0)\n", s->path);
+ goto beach;
+ }
+
+ if ( sr == 0 ) {
+ AUBIO_ERR("source_wavread: Failed opening %s (samplerate can not be 0)\n", s->path);
+ goto beach;
+ }
+
+ if ( byterate == 0 ) {
+ AUBIO_ERR("source_wavread: Failed opening %s (byterate can not be 0)\n", s->path);
+ goto beach;
+ }
+
+ if ( bitspersample == 0 ) {
+ AUBIO_ERR("source_wavread: Failed opening %s (bitspersample can not be 0)\n", s->path);
+ goto beach;
+ }
#if 0
if ( bitspersample != 16 ) {
AUBIO_ERR("source_wavread: can not process %dbit file %s\n",
--
2.18.0