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

LinkedList fixes #14

Merged
merged 4 commits into from
Apr 1, 2024
Merged

LinkedList fixes #14

merged 4 commits into from
Apr 1, 2024

Conversation

willmmiles
Copy link
Collaborator

Clean up the LinkedList class a bit more, fixing a use-after-free bug

  • Remove redundant cache of next pointer in iterator. Fixes use-after-free in AsyncWebServerRequest::_removeNotInterestingHeaders
  • Reduce code duplication
  • Use templated algorithms instead of std::function to improve performance and reduce code size

There's no real need for holding two members; for strictly safe
incrementing, we're going to have to branch regardless.
Template on the predicate functions to avoid std::function overhead,
and clean up the looping logic.
Remove a little bit of duplication.
Saves a little duplicate code.
@willmmiles willmmiles self-assigned this Apr 1, 2024
@willmmiles willmmiles merged commit 72e3a0c into master Apr 1, 2024
0 of 6 checks passed
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.

1 participant