Copying deeply nested NBT causes StackOverflowError
The bug
Unlike NBT loading, NBT copying does not have an upper bound for depth. For this reason, copying deeply nested NBT may cause java.lang.StackOverflowError or create an unloadable NBT whose depth is more than 512.
How to reproduce
/data modify storage mc-201769: : set value {}- Run the following command using a repeating command block
data modify storage mc-201769: :.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.:.: set from storage mc-201769: :
→
Eventually, the game crashes due to java.lang.StackOverflowError.
2020-10-09, 03:35 AM
2024-01-19, 12:58 AM
2022-11-28, 12:21 PM
13
12
1.16.3 - 1.19.2
1.16.3, 1.16.4 Pre-release 1, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05b, 21w08b, 21w10a, 21w11a, 21w13a, 21w15a, 21w16a, 21w19a, 1.17 Pre-release 1, 1.17, 1.17.1, 21w37a, 1.18.1, 22w03a, 22w05a, 1.18.2 Pre-release 1, 1.18.2, 22w11a, 22w12a, 1.19 Release Candidate 2, 1.19, 1.19.2