vlc | branch: master | Steve Lhomme <[email protected]> | Mon Feb 11 09:58:41 2019 +0100| [c850ad31fd888bfaf2e63845b78c219e8de70791] | committer: Hugo Beauzée-Luyssen
contrib: matroska: fix writing on NULL memory https://hackerone.com/reports/493336 Signed-off-by: Hugo Beauzée-Luyssen <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c850ad31fd888bfaf2e63845b78c219e8de70791 --- ...on-t-reset-potentially-unallocated-memory.patch | 29 ++++++++++++++++++++++ contrib/src/matroska/rules.mak | 1 + 2 files changed, 30 insertions(+) diff --git a/contrib/src/matroska/0001-KaxBlock-don-t-reset-potentially-unallocated-memory.patch b/contrib/src/matroska/0001-KaxBlock-don-t-reset-potentially-unallocated-memory.patch new file mode 100644 index 0000000000..caaf040ffc --- /dev/null +++ b/contrib/src/matroska/0001-KaxBlock-don-t-reset-potentially-unallocated-memory.patch @@ -0,0 +1,29 @@ +From 3fa2eeae1d9148b00ff7cebda7304de90ece575b Mon Sep 17 00:00:00 2001 +From: Steve Lhomme <[email protected]> +Date: Mon, 11 Feb 2019 09:51:30 +0100 +Subject: [PATCH] KaxBlock: don't reset potentially unallocated memory + +When using SCOPE_PARTIAL_DATA the GetBuffer()/Data pointer is never allocated. +If this exception occurs we must not write on NULL pointed data. + +When the memory is allocated it doesn't have any use to reset the memory to 0 +since SetValueIsSet(false) is called right before, invalidating the buffer. +--- + src/KaxBlock.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/src/KaxBlock.cpp b/src/KaxBlock.cpp +index 3fa18e5..878d9a2 100644 +--- a/src/KaxBlock.cpp ++++ b/src/KaxBlock.cpp +@@ -703,7 +703,6 @@ filepos_t KaxInternalBlock::ReadData(IOCallback & input, ScopeMode ReadFully) + } catch (SafeReadIOCallback::EndOfStreamX &) { + SetValueIsSet(false); + +- std::memset(EbmlBinary::GetBuffer(), 0, GetSize()); + myBuffers.clear(); + SizeList.clear(); + Timecode = 0; +-- +2.19.1.windows.1 + diff --git a/contrib/src/matroska/rules.mak b/contrib/src/matroska/rules.mak index 158ac59bc1..9370e2de3d 100644 --- a/contrib/src/matroska/rules.mak +++ b/contrib/src/matroska/rules.mak @@ -18,6 +18,7 @@ $(TARBALLS)/libmatroska-$(MATROSKA_VERSION).tar.xz: libmatroska: libmatroska-$(MATROSKA_VERSION).tar.xz .sum-matroska $(UNPACK) + $(APPLY) $(SRC)/matroska/0001-KaxBlock-don-t-reset-potentially-unallocated-memory.patch $(call pkg_static,"libmatroska.pc.in") $(MOVE) _______________________________________________ vlc-commits mailing list [email protected] https://mailman.videolan.org/listinfo/vlc-commits
