Skip to content

TLS_method is declared with the wrong pointer type #131

Description

@SeanTAllen

ssl/net/ssl_context.pony:13 declares use @TLS_method[Pointer[None]](), and :14 takes the result as method: Pointer[None]. TLS_method returns const SSL_METHOD *, and SSL_METHOD is opaque on every backend this repo supports.

A pointer to an opaque C struct should be Pointer[_Name] with a phantom primitive; Pointer[None] is for void * or a pointer only ever passed as null. This pointer is neither, and it is the only declaration in the tree that does this. Two of exactly the same shape get it right: @EVP_sha256[Pointer[_EVPMD]]() at ssl/crypto/digest.pony:32 for const EVP_MD *, and @BIO_s_mem[Pointer[_BIOMethod]]() at ssl/net/ssl.pony:11 for const BIO_METHOD *.

Benign today, since nothing takes addressof an SSL_METHOD. It is the same class of defect as #78 and #80, and neither of those covered it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions