summaryrefslogtreecommitdiff
path: root/src/backend/utils/time/tqual.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/time/tqual.c')
-rw-r--r--src/backend/utils/time/tqual.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/time/tqual.c b/src/backend/utils/time/tqual.c
index b981cd5b84f..57c455ecf3c 100644
--- a/src/backend/utils/time/tqual.c
+++ b/src/backend/utils/time/tqual.c
@@ -1619,8 +1619,8 @@ HeapTupleHeaderIsOnlyLocked(HeapTupleHeader tuple)
static bool
TransactionIdInArray(TransactionId xid, TransactionId *xip, Size num)
{
- return bsearch(&xid, xip, num,
- sizeof(TransactionId), xidComparator) != NULL;
+ return num > 0 &&
+ bsearch(&xid, xip, num, sizeof(TransactionId), xidComparator) != NULL;
}
/*