Skip to content

Fix wrong pointer in compatibility_test_init null check#120677

Open
BrianLegge wants to merge 1 commit into
godotengine:masterfrom
BrianLegge:fix-compatibility-test-init-latin1-null
Open

Fix wrong pointer in compatibility_test_init null check#120677
BrianLegge wants to merge 1 commit into
godotengine:masterfrom
BrianLegge:fix-compatibility-test-init-latin1-null

Conversation

@BrianLegge

Copy link
Copy Markdown

compat_checker.c contains a series of proc-address lookups, each of which retrieves and validates a function pointer. The lookup for string_name_new_with_latin1_chars checks the wrong pointer; it tests the previously assigned classdb_get_method_bind rather than string_name_new_with_latin1_chars.

If string_name_new_with_latin1_chars ever failed to resolve, init would still return success and the extension would later dereference a null pointer in startup_func. This would crash instead of printing the intended "Failed to load interface method" error. This fix aligns the check with the five sibling checks in the same function, each of which validates its own just-assigned pointer.

compat_checker.c contains a series of proc-address lookups, each of which retrieves and validates a function pointer. The lookup for string_name_new_with_latin1_chars checks the wrong pointer; it tests the previously assigned classdb_get_method_bind rather than string_name_new_with_latin1_chars.

If string_name_new_with_latin1_chars ever failed to resolve, init would still return success and the extension would later dereference a NULL pointer in startup_func. This would crash instead of printing the intended "Failed to load interface method" error. This fix aligns the check with the five sibling checks in the same function, each of which validates its own just-assigned pointer.
@BrianLegge BrianLegge requested a review from a team as a code owner June 27, 2026 00:59
@Nintorch Nintorch added this to the 4.x milestone Jun 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants