Skip to content

Fix _pdo_pgsql_trim_message bad access #19239

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

Closed

Conversation

dixyes
Copy link
Contributor

@dixyes dixyes commented Jul 25, 2025

when input const char *message is empty string, the following line will access bad address

@dixyes dixyes marked this pull request as ready for review July 25, 2025 16:36
@dixyes dixyes force-pushed the fix-pdo_pgsql_trim_message-bad-access branch from e0f2741 to ed2cefd Compare July 25, 2025 16:38
@devnexen
Copy link
Member

Hi @dixyes and thanks. Since it is a fix, it might be best to target the lowest supported branch where the bug occurs. 8.3 ? Is the bug reproducible reasonably ? Would be nice to have a test.

@dixyes dixyes force-pushed the fix-pdo_pgsql_trim_message-bad-access branch from ed2cefd to 7c1ee48 Compare July 25, 2025 17:48
@dixyes
Copy link
Contributor Author

dixyes commented Jul 25, 2025

Hi @dixyes and thanks. Since it is a fix, it might be best to target the lowest supported branch where the bug occurs. 8.3 ? Is the bug reproducible reasonably ? Would be nice to have a test.

patch rebased.

I've encountered this when running ext/pdo_pgsql/tests/gh9411.phpt using valgrind. Donot know why ASAN donot throw an error.

@dixyes dixyes changed the base branch from master to PHP-8.3 July 25, 2025 17:49
@dixyes dixyes force-pushed the fix-pdo_pgsql_trim_message-bad-access branch 2 times, most recently from b69bc3f to 4a11ecb Compare July 25, 2025 17:52
@dixyes dixyes force-pushed the fix-pdo_pgsql_trim_message-bad-access branch from 4a11ecb to f8940e3 Compare July 25, 2025 17:53
Copy link
Member

@devnexen devnexen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LCTM

@devnexen devnexen closed this in e16df98 Jul 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants