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

Avoid calling strlcpy when copying string onto itself #17031

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

warmenhoven
Copy link
Contributor

In runloop_check_state, it calls video_shader_get_current_shader_preset to get the shader which returns runloop_st->runtime_shader_preset_path; runloop_check_state passes that to video_shader_apply_shader which calls strlcpy(runloop_st->runtime_shader_preset_path) with that value. Mac really doesn't like strlcpy() when the src and dst overlap; and in this case since they're the same pointer, it's better to just avoid the strlcpy entirely.

@LibretroAdmin LibretroAdmin merged commit 10a1154 into libretro:master Sep 25, 2024
27 checks passed
@warmenhoven warmenhoven deleted the warmenhoven/pr/strlcpy branch September 25, 2024 18:19
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