Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_getarg_type exposes UB to safe code #225

Closed
dtolnay opened this issue Sep 24, 2021 · 0 comments
Closed

get_getarg_type exposes UB to safe code #225

dtolnay opened this issue Sep 24, 2021 · 0 comments
Assignees

Comments

@dtolnay
Copy link

dtolnay commented Sep 24, 2021

pgx::fcinfo::get_getarg_type(0xdeadbeefusize as _, 100);

This results in an out of bounds read at https://github.com/postgres/postgres/blob/48064a8d330db259076fb7b2300544fbf65f4109/src/backend/utils/fmgr/fmgr.c#L1806, which is UB. In general it is unsound for a safe API to result in UB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants