As coded, the start block calculated by BufFileAppend() would overflow
once more than 16k files are used with a default block size. This issue
existed before
b1e5c9fa9ac4, but there's no reason not to be clean about
it.
Per report from Coverity, with a fix suggested by Tom Lane.
int64
BufFileAppend(BufFile *target, BufFile *source)
{
- int64 startBlock = target->numFiles * BUFFILE_SEG_SIZE;
+ int64 startBlock = (int64) target->numFiles * BUFFILE_SEG_SIZE;
int newNumFiles = target->numFiles + source->numFiles;
int i;