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

ostream: fix potential overwrite in StrBuf::sync_impl #1816

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

alex-pentagrid
Copy link
Contributor

In this PR i fixed possible overwrite of trace events: write method can return fewer bytes than requested. In this case were gonig to the second round in the loop and try to write the rest of the buffer, but again use pbase() pointer that points to begin of buffer and write wrong part of buffer.

Now we track position and remaining size correct.

@tklengyel
Copy link
Owner

@drakvuf-jenkins Test this please

@drakvuf-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@tklengyel tklengyel merged commit 889567b into tklengyel:main Nov 22, 2024
33 of 38 checks passed
@alex-pentagrid alex-pentagrid deleted the ostream-overwrite-fix branch November 22, 2024 07:27
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