Skip to content

Conversation

lemire
Copy link
Member

@lemire lemire commented Apr 18, 2023

Alternative to #331

credit to @codebytere

@lemire lemire requested a review from anonrig April 18, 2023 14:15
@lemire
Copy link
Member Author

lemire commented Apr 18, 2023

@anonrig It is not clear to me that we can come up with a test for this because it is not really a buffer overflow (or, at least, the possibility of a buffer overflow has not been demonstrated). Rather the issue is that the code would create an enormous std::string_view pointing at an insane range... but this range would not be accessed so we were fine. It is still terrible code that needs fixing... and it can, indeed, trigger an assert as in llvm/llvm-project#61100

@lemire
Copy link
Member Author

lemire commented Apr 18, 2023

It is pretty obviously bad code that needs fixing. It is not a nuanced thing... I think it just escaped our attention so far because it is a relatively niche scenario.

Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

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

thanks @codebytere

@lemire
Copy link
Member Author

lemire commented Apr 18, 2023

@anonrig commit amended to stipulate that @codebytere is co-author.

@lemire lemire force-pushed the dlemire/issue331 branch 2 times, most recently from 946365d to 3ad80e0 Compare April 18, 2023 15:30
Co-authored-by: codebytere <shelley.vohr@gmail.com>
@lemire lemire force-pushed the dlemire/issue331 branch from 3ad80e0 to 5aea3ef Compare April 18, 2023 15:32
@anonrig anonrig merged commit 5ccf66a into main Apr 18, 2023
@anonrig anonrig deleted the dlemire/issue331 branch April 18, 2023 16:17
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