Skip to content

Fix potential memory corruption #8

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

Merged
merged 1 commit into from
Mar 15, 2018
Merged

Fix potential memory corruption #8

merged 1 commit into from
Mar 15, 2018

Conversation

asp437
Copy link
Contributor

@asp437 asp437 commented Mar 15, 2018

I remove usage of old approach to configure background worker entry point since pg_wait_sampling shouldn't work with PostgreSQL without support of new approach. It fixes potential usage of non-initialized bgw_main pointer which was introduced in #7 (it was my fault).
Also I replaced memcpy call with snprintf because memcpy may read some uninitialized memory or try to read outside the segment/page after the string constants.

@funbringer
Copy link
Collaborator

Good catch! I've just spotted the same error in pg_pathman.

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

Successfully merging this pull request may close these issues.

3 participants