summary refs log tree commit diff
path: root/gnu/packages/patches/mpg321-CVE-2019-14247.patch
diff options
context:
space:
mode:
authorKei Kebreau <kkebreau@posteo.net>2021-03-16 12:03:12 -0400
committerLéo Le Bouter <lle-bout@zaclys.net>2021-03-16 19:12:36 +0100
commit109f58444beecd1b9b7c502f2a687a6b91c62dc0 (patch)
tree2c9bb1d301f675703a11a01cf69be76b7be8ff29 /gnu/packages/patches/mpg321-CVE-2019-14247.patch
parent82a9538ea01596a57bf642d729500f15bcd17f84 (diff)
downloadguix-109f58444beecd1b9b7c502f2a687a6b91c62dc0.tar.gz
gnu: mpg321: Fix CVE-2019-14247.
* gnu/packages/patches/mpg321-CVE-2019-14247.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/mp3.scm (mpg321)[source]: Apply it.

Signed-off-by: Léo Le Bouter <lle-bout@zaclys.net>
Signed-off-by: Leo Famulari <leo@famulari.name>
Diffstat (limited to 'gnu/packages/patches/mpg321-CVE-2019-14247.patch')
-rw-r--r--gnu/packages/patches/mpg321-CVE-2019-14247.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/gnu/packages/patches/mpg321-CVE-2019-14247.patch b/gnu/packages/patches/mpg321-CVE-2019-14247.patch
new file mode 100644
index 0000000000..03afaccc67
--- /dev/null
+++ b/gnu/packages/patches/mpg321-CVE-2019-14247.patch
@@ -0,0 +1,23 @@
+This patch was downloaded from https://sourceforge.net/p/mpg321/bugs/51/ and
+fixes CVE-2019-14247.
+
+Description: Handle illegal bitrate value
+Author: Chrysostomos Nanakos <cnanakos@debian.org>
+Bug-Debian: https://bugs.debian.org/870406
+Bug-Debian: https://bugs.debian.org/887057
+
+--- mpg321-0.3.2.orig/mad.c
++++ mpg321-0.3.2/mad.c
+@@ -574,6 +574,12 @@ void scan(void const *ptr, ssize_t len,
+ 
+     if (!is_vbr)
+     {
++	if (header.bitrate <= 0)                                                
++        {                                                                       
++            fprintf(stderr, "Illegal bit allocation value\n");                                                                              
++            return;                                                             
++        }    
++
+         double time = (len * 8.0) / (header.bitrate); /* time in seconds */
+         double timefrac = (double)time - ((long)(time));
+         long nsamples = 32 * MAD_NSBSAMPLES(&header); /* samples per frame */