summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch')
-rw-r--r--meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch b/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch
new file mode 100644
index 0000000..fa6473d
--- /dev/null
+++ b/meta/recipes-multimedia/libsndfile/files/0001-src-sd2.c-Fix-two-potential-buffer-read-overflows.patch
@@ -0,0 +1,49 @@
1From dbe14f00030af5d3577f4cabbf9861db59e9c378 Mon Sep 17 00:00:00 2001
2From: Erik de Castro Lopo <erikd@mega-nerd.com>
3Date: Thu, 25 Dec 2014 19:23:12 +1100
4Subject: [PATCH] src/sd2.c : Fix two potential buffer read overflows.
5
6(Upstream commit dbe14f00030af5d3577f4cabbf9861db59e9c378)
7
8Closes: https://github.com/erikd/libsndfile/issues/93
9
10Upstream-Status: Backport
11
12Signed-off-by: Yue Tao <yue.tao@windriver.com>
13---
14 src/sd2.c | 12 +++++++++++-
15 1 file changed, 11 insertions(+), 1 deletion(-)
16
17diff --git a/src/sd2.c b/src/sd2.c
18index 0b4e5af..a70a1f1 100644
19--- a/src/sd2.c
20+++ b/src/sd2.c
21@@ -517,6 +517,11 @@ sd2_parse_rsrc_fork (SF_PRIVATE *psf)
22
23 rsrc.type_offset = rsrc.map_offset + 30 ;
24
25+ if (rsrc.map_offset + 28 > rsrc.rsrc_len)
26+ { psf_log_printf (psf, "Bad map offset.\n") ;
27+ goto parse_rsrc_fork_cleanup ;
28+ } ;
29+
30 rsrc.type_count = read_rsrc_short (&rsrc, rsrc.map_offset + 28) + 1 ;
31 if (rsrc.type_count < 1)
32 { psf_log_printf (psf, "Bad type count.\n") ;
33@@ -533,7 +538,12 @@ sd2_parse_rsrc_fork (SF_PRIVATE *psf)
34
35 rsrc.str_index = -1 ;
36 for (k = 0 ; k < rsrc.type_count ; k ++)
37- { marker = read_rsrc_marker (&rsrc, rsrc.type_offset + k * 8) ;
38+ { if (rsrc.type_offset + k * 8 > rsrc.rsrc_len)
39+ { psf_log_printf (psf, "Bad rsrc marker.\n") ;
40+ goto parse_rsrc_fork_cleanup ;
41+ } ;
42+
43+ marker = read_rsrc_marker (&rsrc, rsrc.type_offset + k * 8) ;
44
45 if (marker == STR_MARKER)
46 { rsrc.str_index = k ;
47--
481.7.9.5
49