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

buffer.cpp incorrectly free's the current entry before removing it from the list. #281

Closed
mkilgore opened this issue Jan 8, 2023 · 0 comments · Fixed by #284
Closed
Assignees
Labels
bug Something isn't working

Comments

@mkilgore
Copy link
Contributor

mkilgore commented Jan 8, 2023

Fairly straight forward, in buffer.cpp we free the finished entry and then unlink it from the list, which is a bug as the order is wrong. When we access buffer->head->next to unlink the current entry, we're accessing the entry we just free'd. It is easily fixed by switching the order of those operations.

@mkilgore mkilgore added the bug Something isn't working label Jan 8, 2023
@mkilgore mkilgore self-assigned this Jan 8, 2023
mkilgore added a commit to mkilgore/QB64pe that referenced this issue Jan 8, 2023
Fairly simple, the finished entry is free'd and then removed from the
list, but that order results in us accessing the entry's next member
after it has been free'd. Swapping the order of the operations fixes the
issue.

Fixes: QB64-Phoenix-Edition#281
mkilgore added a commit to mkilgore/QB64pe that referenced this issue Jan 9, 2023
Fairly simple, the finished entry is free'd and then removed from the
list, but that order results in us accessing the entry's next member
after it has been free'd. Swapping the order of the operations fixes the
issue.

Fixes: QB64-Phoenix-Edition#281
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant