[vlc-commits] contrib:ebml: fix a potential crash

Steve Lhomme git at videolan.org
Thu Feb 15 16:39:59 CET 2018


vlc/vlc-3.0 | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Feb  9 13:56:13 2018 +0100| [17b5103de3594cc1cd48b295d27938a14162b51a] | committer: Thomas Guillem

contrib:ebml: fix a potential crash

(cherry picked from commit 6893fd35c0a3b8e45793abb35590490f47092f6e)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=17b5103de3594cc1cd48b295d27938a14162b51a
---

 contrib/src/ebml/ebml-null-compare.patch | 11 +++++++++++
 contrib/src/ebml/rules.mak               |  1 +
 2 files changed, 12 insertions(+)

diff --git a/contrib/src/ebml/ebml-null-compare.patch b/contrib/src/ebml/ebml-null-compare.patch
new file mode 100644
index 0000000000..a82a3c63f3
--- /dev/null
+++ b/contrib/src/ebml/ebml-null-compare.patch
@@ -0,0 +1,11 @@
+--- ebml/src/EbmlBinary.cpp	2018-02-09 13:51:37.752623200 +0100
++++ ebml/src/EbmlBinary.cpp.null_cmp	2018-02-09 13:50:41.409429100 +0100
+@@ -100,7 +100,7 @@ filepos_t EbmlBinary::ReadData(IOCallbac
+ 
+ bool EbmlBinary::operator==(const EbmlBinary & ElementToCompare) const
+ {
+-  return ((GetSize() == ElementToCompare.GetSize()) && !memcmp(Data, ElementToCompare.Data, GetSize()));
++  return ((GetSize() == ElementToCompare.GetSize()) && (GetSize() == 0 || !memcmp(Data, ElementToCompare.Data, GetSize())));
+ }
+ 
+ END_LIBEBML_NAMESPACE
diff --git a/contrib/src/ebml/rules.mak b/contrib/src/ebml/rules.mak
index e916559166..5512a129cf 100644
--- a/contrib/src/ebml/rules.mak
+++ b/contrib/src/ebml/rules.mak
@@ -18,6 +18,7 @@ ebml: libebml-$(EBML_VERSION).tar.xz .sum-ebml
 	$(APPLY) $(SRC)/ebml/unknown-check.patch
 	$(APPLY) $(SRC)/ebml/max-size-loop.patch
 	$(APPLY) $(SRC)/ebml/ebml-end-boundary.patch
+	$(APPLY) $(SRC)/ebml/ebml-null-compare.patch
 	$(MOVE)
 
 # libebml requires exceptions



More information about the vlc-commits mailing list