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

Fix undefined behavior related to function pointer cast #184

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

Koromix
Copy link
Contributor

@Koromix Koromix commented Dec 10, 2024

Casting a function pointer to a different function pointer type is undefined behavior in C, and triggers UBSan as shown below:

image

This PR fixes this by changing the declaration of sqlite3mcFreeCodecParameterTable to take a void * pointer and avoid the cast entirely.

@utelle
Copy link
Owner

utelle commented Dec 10, 2024

Thanks for reporting the issue and providing a fix.

@utelle utelle merged commit 08edcd9 into utelle:main Dec 10, 2024
9 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
Development

Successfully merging this pull request may close these issues.

2 participants