Skip to content

Commit

Permalink
Avoid integer multiplication overflow in getMemoryUsage (thanks FindB…
Browse files Browse the repository at this point in the history
…ugs!)
  • Loading branch information
JoshRosen committed May 11, 2015
1 parent 1e3ad52 commit 39434f9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ void spill() throws IOException {
}

private long getMemoryUsage() {
return sorter.getMemoryUsage() + (allocatedPages.size() * PAGE_SIZE);
return sorter.getMemoryUsage() + (allocatedPages.size() * (long) PAGE_SIZE);
}

private long freeMemory() {
Expand Down

0 comments on commit 39434f9

Please sign in to comment.