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

String + struct = segfault #52

Open
skyfloogle opened this issue Apr 27, 2023 · 0 comments
Open

String + struct = segfault #52

skyfloogle opened this issue Apr 27, 2023 · 0 comments

Comments

@skyfloogle
Copy link

skyfloogle commented Apr 27, 2023

The pattern language (both ImHex and the browser playground) will segfault upon running the following code:

struct A {};
A a;
str b = "" + a;

I debugged this a little bit, and it looks like the issue is in Pattern::getValue(). The clone() call creates a unique_ptr, which is freed when the function is done, but its pointer is left in the returned value, which is no longer valid.

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

No branches or pull requests

1 participant