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

Block loading of incompatible IBinTools interface #979

Merged

Conversation

@peace-maker
Copy link
Member

@peace-maker peace-maker commented Apr 9, 2019

In #705 SourceMod received support for x64 binaries. The IBinTools interface was updated to call functions in 64bit binaries. The PassInfo struct's size was increased and the Create[V]Call() functions signatures changed, thus making the interface incompatible for consumers which were compiled against an earlier version.

IBinTools::IsVersionCompatible wasn't adjusted to that fact, so extensions compiled against pre SM 1.10 could request an IBinTools interface pointer, but crash when they try to use it.

This change makes requests to older interface versions invalid, thus letting RequestInterface return NULL for older extensions. It doesn't fix the backwards incompatibility, but at least makes the problem more blatant, so extensions can handle it themselves.

In alliedmodders#705 SourceMod received support for x64 binaries. The `IBinTools` interface was updated to call functions in 64bit binaries. The `PassInfo` struct's size was increased and the `Create(V)Call()` functions signatures changed, thus making the interface incompatible for consumers which were compiled against an earlier version.

`SMInterface::IsVersionCompatible` wasn't adjusted to that fact, so extensions compiled against pre SM 1.10 could request an `IBinTools` interface pointer, but crash when they try to use it.

This change makes requests to older interface versions invalid, thus letting `RequestInterface` return `NULL` for older extensions. It doesn't fix the backwards incompatibility, but at least makes the problem more blatant, so extensions can handle it themselves.
@Headline Headline added the Bug label Apr 10, 2019
@KyleSanderson
Copy link
Member

@KyleSanderson KyleSanderson commented Apr 11, 2019

Ah shoot, thank you very much.

@KyleSanderson KyleSanderson merged commit e3f4d23 into alliedmodders:master Apr 11, 2019
2 checks passed
@peace-maker peace-maker deleted the bintools_backwards_incomp branch Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants