From 60e7afa6cd4850e250229fd05571c7529ccecad1 Mon Sep 17 00:00:00 2001 From: Justin Aquadro Date: Wed, 22 May 2013 02:58:15 -0400 Subject: [PATCH] Fix NBT parse crash when list has type TAG_End --- SubstrateCS/Source/Nbt/NbtTree.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SubstrateCS/Source/Nbt/NbtTree.cs b/SubstrateCS/Source/Nbt/NbtTree.cs index b1b95c1..081fbc0 100644 --- a/SubstrateCS/Source/Nbt/NbtTree.cs +++ b/SubstrateCS/Source/Nbt/NbtTree.cs @@ -302,6 +302,9 @@ namespace Substrate.Nbt throw new NBTException(NBTException.MSG_READ_NEG); } + if (val.ValueType == TagType.TAG_END) + return val; + for (int i = 0; i < length; i++) { val.Add(ReadValue(val.ValueType)); }