Package: sox / 14.4.1-5+deb9u2

0002-fix-possible-buffer-size-overflow-in-lsx_make_lpf-CV.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From f70911261a84333b077c29908e1242f69d7439eb Mon Sep 17 00:00:00 2001
From: Mans Rullgard <mans@mansr.com>
Date: Wed, 24 Apr 2019 14:57:34 +0100
Subject: [PATCH 2/5] fix possible buffer size overflow in lsx_make_lpf()
 (CVE-2019-8354)

The multiplication in the size argument malloc() might overflow,
resulting in a small buffer being allocated.  Use calloc() instead.
---
 src/effects_i_dsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/src/effects_i_dsp.c
+++ b/src/effects_i_dsp.c
@@ -256,7 +256,7 @@
 double * lsx_make_lpf(int num_taps, double Fc, double beta, double scale, sox_bool dc_norm)
 {
   int i, m = num_taps - 1;
-  double * h = malloc(num_taps * sizeof(*h)), sum = 0;
+  double * h = calloc(num_taps, sizeof(*h)), sum = 0;
   double mult = scale / lsx_bessel_I_0(beta);
   assert(Fc >= 0 && Fc <= 1);
   lsx_debug("make_lpf(n=%i, Fc=%g beta=%g dc-norm=%i scale=%g)", num_taps, Fc, beta, dc_norm, scale);