20300673 problem in LIBRARY/LIBSNDFILE s11u2-sru
authorRich Burridge <rich.burridge@oracle.com>
Fri, 09 Jan 2015 13:30:37 -0800
branchs11u2-sru
changeset 3609 4f3b656821cd
parent 3608 bd6da1c6bb63
child 3610 70f156a82910
20300673 problem in LIBRARY/LIBSNDFILE
components/libsndfile/patches/CVE-2014-9496.patch
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libsndfile/patches/CVE-2014-9496.patch	Fri Jan 09 13:30:37 2015 -0800
@@ -0,0 +1,36 @@
+Fix two potential buffer read overflows.
+
+Upstream bug report:
+https://github.com/erikd/libsndfile/issues/93
+
+Upstream fix:
+https://github.com/erikd/libsndfile/commit/dbe14f00030af5d3577f4cabbf9861db59e9c378
+
+--- libsndfile-1.0.23/src/sd2.c.orig	2015-01-07 13:06:58.205315569 -0800
++++ libsndfile-1.0.23/src/sd2.c	2015-01-07 13:15:21.501444431 -0800
[email protected]@ -496,6 +496,11 @@
+ 
+ 	rsrc.type_offset = rsrc.map_offset + 30 ;
+ 
++	if (rsrc.map_offset + 28 > rsrc.rsrc_len)
++	{	psf_log_printf (psf, "Bad map offset.\n") ;
++		goto parse_rsrc_fork_cleanup ;
++		} ;
++
+ 	rsrc.type_count = read_short (rsrc.rsrc_data, rsrc.map_offset + 28) + 1 ;
+ 	if (rsrc.type_count < 1)
+ 	{	psf_log_printf (psf, "Bad type count.\n") ;
[email protected]@ -512,7 +517,12 @@
+ 
+ 	rsrc.str_index = -1 ;
+ 	for (k = 0 ; k < rsrc.type_count ; k ++)
+-	{	marker = read_marker (rsrc.rsrc_data, rsrc.type_offset + k * 8) ;
++	{	if (rsrc.type_offset + k * 8 > rsrc.rsrc_len)
++		{	psf_log_printf (psf, "Bad rsrc marker.\n") ;
++			goto parse_rsrc_fork_cleanup ;
++			} ;
++
++		marker = read_marker (rsrc.rsrc_data, rsrc.type_offset + k * 8) ;
+ 
+ 		if (marker == STR_MARKER)
+ 		{	rsrc.str_index = k ;