You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's probably a number of issues like this across pgx. We should definitely declare this functions (and its callers) as unsafe. That particular function is meant to mimic the Postgres ItemPointerIsValid macro:
/* * ItemPointerIsValid * True iff the disk item pointer is not NULL. */#defineItemPointerIsValid(pointer) \
((bool) (PointerIsValid(pointer) && ((pointer)->ip_posid != 0)))
Giving it a bad pointer like 0xdeadbeef isn't a thing we can trap (afaik?), so all I can see is to mark it unsafe.
For example, the following safe program leads to pgx performing Undefined Behavior:
Segmentation fault (core dumped)
In general it is unsound for a safe API to result in UB.
The text was updated successfully, but these errors were encountered: