|
|
|
@ -171,10 +171,12 @@ func decodeAnyOrError(decoder *Decoder, destination reflect.Value, tag Tag) (n i
|
|
|
|
if length > uint64(MaxStructureLength) {
|
|
|
|
if length > uint64(MaxStructureLength) {
|
|
|
|
return 0, ErrTooLong
|
|
|
|
return 0, ErrTooLong
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
lengthCast, err := Uint64ToIntSafe(length)
|
|
|
|
|
|
|
|
if err != nil { return n, err }
|
|
|
|
oneTag, nn, err := decoder.ReadTag()
|
|
|
|
oneTag, nn, err := decoder.ReadTag()
|
|
|
|
n += nn; if err != nil { return n, err }
|
|
|
|
n += nn; if err != nil { return n, err }
|
|
|
|
if destination.Cap() < int(length) {
|
|
|
|
if destination.Cap() < lengthCast {
|
|
|
|
destination.Grow(int(length) - destination.Cap())
|
|
|
|
destination.Grow(lengthCast - destination.Cap())
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// skip the rest of the array if the one tag doesn't
|
|
|
|
// skip the rest of the array if the one tag doesn't
|
|
|
|
// match up with the destination
|
|
|
|
// match up with the destination
|
|
|