Skip to content

Fix format specifiers and arguments in com_dotnet #15398

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 3 commits into from
Aug 15, 2024

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Aug 14, 2024

This is mostly about minor glitches (signedness or length confusion), but also fixes two occasions where zend_string still have be regarded as char *.


clang (16.0.0) was very helpful with this.

This is mostly about minor glitches (signedness or length confusion),
but also fixes two occasions where `zend_string` still have be regarded
as `char *`.
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

Surprised this didn't cause issues before.

@cmb69
Copy link
Member Author

cmb69 commented Aug 14, 2024

Surprised this didn't cause issues before.

Well, I assume that is because

  • com_dotnet is rarely used
  • most of the issues are minor (signedness, length)
  • a couple of the mismatches are used in trace() which will only output something, when attached to a debugger

I've now added a test for the only issue I consider a problem, but this also only happens if you try to access a property of a COM object, which is unknown; you fix that code, and go on with life.

@cmb69
Copy link
Member Author

cmb69 commented Aug 14, 2024

Surprised this didn't cause issues before.

Well, I assume that is because

  • com_dotnet is rarely used
  • most of the issues are minor (signedness, length)
  • a couple of the mismatches are used in trace() which will only output something, when attached to a debugger

I've now added a test for the only issue I consider a problem, but this also only happens if you try to access a property of a COM object, which is unknown; you fix that code, and go on with life.

PS: forgot to mention that there couldn't be any real OOB reads, due to the layout of zend_string and the fact that its val is always zero terminated.

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

Thanks for the added test!

@cmb69 cmb69 merged commit 4b2dc58 into php:master Aug 15, 2024
10 checks passed
@cmb69 cmb69 deleted the cmb/com-printf branch August 15, 2024 09:01
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