Skip to content

Commit

Permalink
fix: avoid integer oveflow when multiplying necessaryCapacity
Browse files Browse the repository at this point in the history
  • Loading branch information
aoles committed Dec 3, 2023
1 parent 60f68e8 commit 1608a62
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public boolean loadExisting() {
public void init() {
borderNodes.create(1000);
getNumBorderNodes();
borderNodes.ensureCapacity((long) borderNodeCount * byteCount + necessaryCapacity * byteCount + borderNodeCount * 4);
borderNodes.ensureCapacity((long) borderNodeCount * byteCount + (long) necessaryCapacity * byteCount + borderNodeCount * 4);
borderNodes.setHeader(0, borderNodeCount);
borderNodeIndexOffset = borderNodeCount * byteCount;
borderNodePointer = borderNodeIndexOffset;
Expand Down

0 comments on commit 1608a62

Please sign in to comment.