shithub: sox

Download patch

ref: 2ce02fea7b350de9ddfbcf542ba4dd59a8ab255b
parent: b7883ae1398499daaa926ae6621f088f0f531ed8
author: Mans Rullgard <mans@mansr.com>
date: Wed Apr 24 11:08:51 EDT 2019

fix possible null pointer deref in lsx_make_lpf() (CVE-2019-8357)

If the buffer allocation fails, return NULL.

--- a/src/effects_i_dsp.c
+++ b/src/effects_i_dsp.c
@@ -362,6 +362,9 @@
   assert(Fc >= 0 && Fc <= 1);
   lsx_debug("make_lpf(n=%i Fc=%.7g β=%g ρ=%g dc-norm=%i scale=%g)", num_taps, Fc, beta, rho, dc_norm, scale);
 
+  if (!h)
+    return NULL;
+
   for (i = 0; i <= m / 2; ++i) {
     double z = i - .5 * m, x = z * M_PI, y = z * mult1;
     h[i] = x? sin(Fc * x) / x : Fc;