1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2026-06-21 01:34:15 +02:00

find_zero_tail: fix last bytes check

This commit is contained in:
Yura Sokolov
2022-10-24 16:52:38 +03:00
parent b568f2254a
commit 202f2ade7f
+3 -3
View File
@@ -2649,9 +2649,9 @@ find_zero_tail(char *buf, size_t len)
return 0;
/* fast check for last bytes */
i = (len-1) & ~(PAGE_ZEROSEARCH_FINE_GRANULARITY-1);
l = len - i;
if (memcmp(buf + i, zerobuf, i) != 0)
l = Min(len, PAGE_ZEROSEARCH_FINE_GRANULARITY);
i = len - l;
if (memcmp(buf + i, zerobuf, l) != 0)
return len;
/* coarse search for zero tail */