From 68b53e136ca72b07211b502addde2c628be4e319 Mon Sep 17 00:00:00 2001 From: vit9696 Date: Sun, 7 Apr 2019 21:30:04 +0300 Subject: [PATCH] OcXmlLib: Fix potential buffer overflow when deserializing mdata --- Library/OcXmlLib/OcXmlLib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/OcXmlLib/OcXmlLib.c b/Library/OcXmlLib/OcXmlLib.c index a917d694..f9cdae9e 100755 --- a/Library/OcXmlLib/OcXmlLib.c +++ b/Library/OcXmlLib/OcXmlLib.c @@ -1574,6 +1574,8 @@ PlistMetaDataValue ( if (PlistNodeCast (Node, PLIST_NODE_TYPE_DATA) != NULL) { Content = XmlNodeContent (Node); if (Content != NULL) { + + Length = *Size; Result = OcBase64Decode (Content, AsciiStrLen (Content), Buffer, &Length); if (!RETURN_ERROR (Result) && (UINT32) Length == Length) {