Add assertion to check the special size is sane before dereferencing it.
This seems useful to catch errors of the sort I just fixed, where PageGetSpecialPointer is called before initializing the page.
This commit is contained in:
parent
fdf28853ae
commit
302ac7f271
@ -304,6 +304,8 @@ typedef PageHeaderData *PageHeader;
|
||||
#define PageGetSpecialPointer(page) \
|
||||
( \
|
||||
AssertMacro(PageIsValid(page)), \
|
||||
AssertMacro(((PageHeader) (page))->pd_special <= BLCKSZ), \
|
||||
AssertMacro(((PageHeader) (page))->pd_special >= SizeOfPageHeaderData), \
|
||||
(char *) ((char *) (page) + ((PageHeader) (page))->pd_special) \
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user