void-packages/srcpkgs/libsndfile/patches/CVE-2018-13139.patch

30 lines
817 B
Diff

commit aaea680337267bfb6d2544da878890ee7f1c5077
Author: Brett T. Warden <brett.t.warden@intel.com>
Date: Tue Aug 28 12:01:17 2018 -0700
Check MAX_CHANNELS in sndfile-deinterleave
Allocated buffer has space for only 16 channels. Verify that input file
meets this limit.
Fixes #397
diff --git programs/sndfile-deinterleave.c programs/sndfile-deinterleave.c
index 53660310..225b4d54 100644
--- programs/sndfile-deinterleave.c
+++ programs/sndfile-deinterleave.c
@@ -89,6 +89,13 @@ main (int argc, char **argv)
exit (1) ;
} ;
+ if (sfinfo.channels > MAX_CHANNELS)
+ { printf ("\nError : Input file '%s' has too many (%d) channels. Limit is %d.\n",
+ argv [1], sfinfo.channels, MAX_CHANNELS) ;
+ exit (1) ;
+ } ;
+
+
state.channels = sfinfo.channels ;
sfinfo.channels = 1 ;