verify that a list pointer has the correct kind

This commit is contained in:
David Renshaw 2021-09-30 22:52:00 -04:00
parent 104fb11104
commit 8f5f200858

View file

@ -1165,6 +1165,10 @@ final class WireHelpers {
FollowFarsResult resolved = followFars(ref, refTarget, segment);
if (WirePointer.kind(resolved.ref) != WirePointer.LIST) {
throw new DecodeException("Message contains non-list pointer where list was expected.");
}
byte elementSize = ListPointer.elementSize(resolved.ref);
switch (elementSize) {
case ElementSize.INLINE_COMPOSITE : {