From c0bd4824482e476904bcf7b75c3f922400cc11c6 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Mon, 20 Apr 2015 08:33:35 +0200 Subject: Protocol 1.8: Limit the amount of displayed data on NBT parse failure. --- src/Protocol/Protocol18x.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index 62c8a30df..0baae00de 100644 --- a/src/Protocol/Protocol18x.cpp +++ b/src/Protocol/Protocol18x.cpp @@ -2675,7 +2675,7 @@ void cProtocol180::ParseItemMetadata(cItem & a_Item, const AString & a_Metadata) if (!NBT.IsValid()) { AString HexDump; - CreateHexDump(HexDump, a_Metadata.data(), a_Metadata.size(), 16); + CreateHexDump(HexDump, a_Metadata.data(), std::max(a_Metadata.size(), 1024), 16); LOGWARNING("Cannot parse NBT item metadata: (" SIZE_T_FMT " bytes)\n%s", a_Metadata.size(), HexDump.c_str()); return; } -- cgit v1.2.3