vlc | branch: master | Steve Lhomme <rob...@ycbcr.xyz> | Fri Feb  9 13:56:13 
2018 +0100| [6893fd35c0a3b8e45793abb35590490f47092f6e] | committer: Steve Lhomme

contrib:ebml: fix a potential crash

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6893fd35c0a3b8e45793abb35590490f47092f6e
---

 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

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to