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

C3D_BindProgram stores a pointer to a Program (use-after-free in bind_program) #37

Open
Jhynjhiruu opened this issue Jan 7, 2024 · 0 comments

Comments

@Jhynjhiruu
Copy link

C3D_BindProgram stores the passed-in pointer to a shader::Program in the C3D context. Currently, bind_program takes a reference to a Program, meaning that it's possible to pass in a Program that is dropped before the context attempts to use it (at the end of the frame, when it's rendered). This leads to a use-after-free and generally a crash.
This can be avoided by the Instance taking ownership of the passed-in Program, and storing it in some kind of data type that can be Pinned.

0x00002a added a commit to Team-Yarg/citro3d-rs that referenced this issue Jan 22, 2024
Bash-09 pushed a commit to Bash-09/citro3d-rs that referenced this issue Sep 26, 2024
Bash-09 pushed a commit to Bash-09/citro3d-rs that referenced this issue Sep 27, 2024
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