Skip to content

Commit

Permalink
Fix ability to int overflow when adding to LP network
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruling-0 committed Jan 16, 2025
1 parent 84e41cc commit 43715af
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public static int addCurrentEssenceToMaximum(String ownerName, int addedEssence,

int currEss = data.currentEssence;

if (currEss >= event.maximum) {
if (currEss >= event.maximum || Integer.MAX_VALUE - event.addedAmount < currEss) {
return 0;
}

Expand Down

0 comments on commit 43715af

Please sign in to comment.