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

ICU-22753 Fix read-after-move in MF2 #2983

Merged
merged 1 commit into from May 14, 2024

Conversation

catamorphism
Copy link
Contributor

@catamorphism catamorphism commented Apr 25, 2024

In StaticErrors::addError() and DynamicErrors::addError(), don't read from e after moving out of it.

It's surprising to me that this error wasn't caught by asan or ubsan.

Checklist
  • Required: Issue filed: https://unicode-org.atlassian.net/browse/ICU-22753
  • Required: The PR title must be prefixed with a JIRA Issue number.
  • Required: The PR description must include the link to the Jira Issue, for example by completing the URL in the first checklist item
  • Required: Each commit message must be prefixed with a JIRA Issue number.
  • Issue accepted (done by Technical Committee after discussion)
  • Tests included, if applicable
  • API docs and/or User Guide docs changed or added, if applicable

In StaticErrors::addError() and DynamicErrors::addError(),
don't read from `e` after moving out of it.
@catamorphism
Copy link
Contributor Author

cc @mihnita @roubert

@roubert roubert self-requested a review April 26, 2024 13:51
@roubert roubert self-assigned this Apr 26, 2024
Copy link
Member

@roubert roubert left a comment

Choose a reason for hiding this comment

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

LGTM

@echeran echeran merged commit e6ac2a2 into unicode-org:main May 14, 2024
97 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
3 participants