Skip to content

Fix UB due to iterator reaching before begin() in rich header parsing #987

Merged
PeterMatula merged 2 commits intoavast:masterfrom
HoundThe:fix_rich_header_ub
Jul 15, 2021
Merged

Fix UB due to iterator reaching before begin() in rich header parsing #987
PeterMatula merged 2 commits intoavast:masterfrom
HoundThe:fix_rich_header_ub

Conversation

@HoundThe
Copy link
Copy Markdown
Member

There was an undefined behavior because iterator pointing to begin() got decremented when the rich header parsing loop ends.

@PeterMatula PeterMatula self-requested a review July 15, 2021 12:48
Copy link
Copy Markdown
Collaborator

@PeterMatula PeterMatula left a comment

Choose a reason for hiding this comment

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

I think it is ok, but (reverse) iterators are tricky, so please give it a second look based on my comments.

@PeterMatula PeterMatula merged commit a2a4226 into avast:master Jul 15, 2021
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.

2 participants