postgresql/contrib/amcheck
Peter Geoghegan a9ce839a31 Sanitize line pointers within contrib/amcheck.
Adopt a more defensive approach to accessing index tuples in
contrib/amcheck: verify that each line pointer looks sane before
accessing associated tuple using pointer arithmetic based on line
pointer's offset.  This avoids undefined behavior and assertion failures
in cases where line pointers are corrupt.

Issue spotted following a complaint about an assertion failure by
Grigory Smolkin, which involved a test harness that deliberately
corrupts indexes.

This is arguably a bugfix, but no backpatch given the lack of field
reports beyond Grigory's.

Discussion: https://postgr.es/m/CAH2-WzmkurhCqnyLHxk0VkOZqd49+ZZsp1xAJOg7j2x7dmp_XQ@mail.gmail.com
2019-04-25 12:50:37 -07:00
..
expected Add test coverage for rootdescend verification. 2019-04-04 17:25:35 -07:00
sql Add test coverage for rootdescend verification. 2019-04-04 17:25:35 -07:00
.gitignore Add .gitignore to contrib/amcheck. 2017-03-09 22:45:24 -05:00
Makefile Allow amcheck to re-find tuples using new search. 2019-03-20 10:41:36 -07:00
amcheck--1.0--1.1.sql Add amcheck verification of heap relations belonging to btree indexes. 2018-03-31 19:52:01 -07:00
amcheck--1.0.sql Add amcheck extension to contrib. 2017-03-09 16:33:02 -08:00
amcheck--1.1--1.2.sql Allow amcheck to re-find tuples using new search. 2019-03-20 10:41:36 -07:00
amcheck.control Allow amcheck to re-find tuples using new search. 2019-03-20 10:41:36 -07:00
verify_nbtree.c Sanitize line pointers within contrib/amcheck. 2019-04-25 12:50:37 -07:00