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

Fixed crash in QPCleaner, when line is too long and buffer is almost full #220

Merged
merged 1 commit into from Sep 29, 2021

Conversation

pavelbazika
Copy link
Contributor

Hi,

there is a bug in new QPCleaner implementation, which causes panic. When the qp.lineLen exceeds MaxQPLineLen, newline is safely inserted to dest buffer. But it is not checked, if n is still < destLen after this insertion, causing write after the end of dest in the following switch statement.

Here is a fix and test, the test causes panic on current version, the checks are there just for completeness.

Best regards

Pavel

@jhillyerd
Copy link
Owner

Thanks for catching this!

@jhillyerd jhillyerd merged commit 45317ac into jhillyerd:master Sep 29, 2021
@pavelbazika pavelbazika deleted the qpcleaner-crash branch September 29, 2021 15:56
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.

None yet

2 participants