Skip to content

Commit

Permalink
Handle hypothetical object size greater than 2^32B.
Browse files Browse the repository at this point in the history
hypopg_relation_size wasn't careful when converting the number of blocks to
bytes, as the result can overflow an int32.

Per report from Jan Koßmann.
  • Loading branch information
rjuju committed Feb 20, 2020
1 parent 8827086 commit b41bd64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ People who contributed to hypopg:
* Joel Van Horn
* Michael Lroll
* Godwottery
* Jan Koßmann
2 changes: 1 addition & 1 deletion hypopg_index.c
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ hypopg_relation_size(PG_FUNCTION_ARGS)
}
}

PG_RETURN_INT64(pages * BLCKSZ);
PG_RETURN_INT64(pages * 1.0L * BLCKSZ);
}

/*
Expand Down

0 comments on commit b41bd64

Please sign in to comment.