freebsd-ports/audio/libsndfile/files/patch-CVE-2017-14634
Jason E. Hale 466738b16b Add several security fixes addressing:
- CVE-2017-6892
- CVE-2017-8361
- CVE-2017-8362
- CVE-2017-8363
- CVE-2017-8365
- CVE-2017-12562
- CVE-2017-14634

Note:
- Fix for CVE-2017-8365 is included in files/patch-CVE-2017-8361

While here:
- Fix LICENSE and add LICENSE_FILE

PR:		226271
Submitted by:	jhale
Reviewed by:	koobs, eadler, jbeich
Approved by:	ports-secteam (eadler)
Obtained from:	upstream (https://github.com/erikd/libsndfile)
MFH:		2018Q1
Security:	004debf9-1d16-11e8-b6aa-4ccc6adda413
Security:	2b386075-1d9c-11e8-b6aa-4ccc6adda413
Differential Revision:	https://reviews.freebsd.org/D14552
2018-03-02 00:42:07 +00:00

29 lines
1.1 KiB
Text

From 85c877d5072866aadbe8ed0c3e0590fbb5e16788 Mon Sep 17 00:00:00 2001
From: Fabian Greffrath <fabian@greffrath.com>
Date: Thu, 28 Sep 2017 12:15:04 +0200
Subject: [PATCH] double64_init: Check psf->sf.channels against upper bound
This prevents division by zero later in the code.
While the trivial case to catch this (i.e. sf.channels < 1) has already
been covered, a crafted file may report a number of channels that is
so high (i.e. > INT_MAX/sizeof(double)) that it "somehow" gets
miscalculated to zero (if this makes sense) in the determination of the
blockwidth. Since we only support a limited number of channels anyway,
make sure to check here as well.
CVE-2017-14634
Closes: https://github.com/erikd/libsndfile/issues/318
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
--- src/double64.c.orig 2016-04-01 21:08:53 UTC
+++ src/double64.c
@@ -91,7 +91,7 @@ int
double64_init (SF_PRIVATE *psf)
{ static int double64_caps ;
- if (psf->sf.channels < 1)
+ if (psf->sf.channels < 1 || psf->sf.channels > SF_MAX_CHANNELS)
{ psf_log_printf (psf, "double64_init : internal error : channels = %d\n", psf->sf.channels) ;
return SFE_INTERNAL ;
} ;