Create: Numismatics

Create: Numismatics

712k Downloads

Integer overflow with `nm pay` command at 2147483647

VityaSchel opened this issue ยท 1 comments

commented

Description

Yeah basically if you have a balance of 2147483647 and run nm pay command it overflows and goes negative. Not sure if it was eventually fixed though I'm on 1.0.10
And it's not even too much honestly. 2147483647/4096/64 is 8191 so you only need about 303 shulkers filled up completely with stacks of 64 suns to get overflow. Pretty much achievable if server admins don't turn off diamonds->currency conversion and someone (let's not name him (zggolddz)) builds a create drill and mines all diamond ore in 1000 block radius around spawn and netherite in hell using complex deployer mechanisms so that then there is not a single player on server who can even build their own machine

ahem so as I was saying it's probably a good idea to at least throw an exception if we detect that overflow might happen. it's as simple as putting if (Integer.MAX_VALUE - this.balance < amount) to deposit function in content/backend/BankAccount.java

Game Log

N/A

Debug Information

No response