diff options
author | Damiano Galassi <[email protected]> | 2019-12-22 12:32:18 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2019-12-24 08:57:59 +0100 |
commit | 683743dcee534a2f1129f30badbadf6b474d8ed8 (patch) | |
tree | 7a64ab7e09a74dbba618260f6530115dbb520644 | |
parent | edee13a55edef14ff39ad52f2497a7cc5aa860d2 (diff) |
libbluray: fix a possible out of bounds read on macOS.
(cherry picked from commit e9655e95179431a7ba7cd1fff316a805427ee159)
-rw-r--r-- | contrib/libbluray/P03-darwin-mount.patch | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/contrib/libbluray/P03-darwin-mount.patch b/contrib/libbluray/P03-darwin-mount.patch new file mode 100644 index 000000000..202d847cb --- /dev/null +++ b/contrib/libbluray/P03-darwin-mount.patch @@ -0,0 +1,21 @@ +diff --git a/src/file/mount_darwin.c b/src/file/mount_darwin.c +index f7abb1a..394437a 100644 +--- a/src/file/mount_darwin.c ++++ b/src/file/mount_darwin.c +@@ -45,11 +45,15 @@ char *mount_get_mountpoint(const char *device_path) + return str_dup(device_path); + } + +- struct statfs mbuf[128]; ++ struct statfs mbuf[256]; + int fs_count; + + if ( (fs_count = getfsstat (NULL, 0, MNT_NOWAIT)) != -1 ) { + ++ if (fs_count > 256) { ++ fs_count = 256; ++ } ++ + getfsstat (mbuf, fs_count * sizeof(mbuf[0]), MNT_NOWAIT); + + for ( int i = 0; i < fs_count; ++i) { |