shithub: flite

Download patch

ref: fa0486e6290dc160b0431513a7536d2a0fc3d6ed
parent: e4ff39a77cfa1c09e5a5486005f0b9ea5a50250e
parent: a3ff166a5a99ea97f9037a82f5c2a578348291ac
author: CMU Festvox Project <31623582+festvox@users.noreply.github.com>
date: Sun Mar 4 03:31:23 EST 2018

Merge pull request #3 from paulgevers/CVE-2014-0027

Only write audio data to a temporariy file in debug builds

--- a/src/audio/auserver.c
+++ b/src/audio/auserver.c
@@ -67,9 +67,11 @@
     int q,i,n,r;
     unsigned char bytes[CST_AUDIOBUFFSIZE];
     short shorts[CST_AUDIOBUFFSIZE];
+#ifdef DEBUG
     cst_file fff;
 
     fff = cst_fopen("/tmp/awb.wav",CST_OPEN_WRITE|CST_OPEN_BINARY);
+#endif
 
     if ((audio_device = audio_open(header->sample_rate,1,
 				   (header->encoding == CST_SND_SHORT) ?
@@ -116,7 +118,9 @@
 	for (q=r; q > 0; q-=n)
 	{
 	    n = audio_write(audio_device,shorts,q);
+#ifdef DEBUG
 	    cst_fwrite(fff,shorts,2,q);
+#endif
 	    if (n <= 0)
 	    {
 		audio_close(audio_device);
@@ -125,7 +129,9 @@
 	}
     }
     audio_close(audio_device);
+#ifdef DEBUG
     cst_fclose(fff);
+#endif
 
     return CST_OK_FORMAT;