]> git.codecow.com Git - Monocypher.git/commit
Fixed undefined function pointer conversion
authorLoup Vaillant <loup@loup-vaillant.fr>
Sun, 1 Dec 2019 10:42:30 +0000 (11:42 +0100)
committerLoup Vaillant <loup@loup-vaillant.fr>
Sun, 1 Dec 2019 10:42:30 +0000 (11:42 +0100)
commit63caacc26a0d828a9302dd52ba7a32e87b82c39b
tree81ee90d83817b0e66308c7ba31e8bf63b49a774e
parentda427dde5726585e457b8ddb94ec8e5ef0bdef4e
Fixed undefined function pointer conversion

The TIS interpreter is not happy when we call a function from an
incompatible pointer type.  GCC and Clang don't seem to mind as long as
we explicitly convert the pointer, but apparently that's undefined
behaviour, even though the only incompatibility is transforming a
pointer argument into a void* argument.

I don't know if it's a false positive, but better safe than sorry. The
conversion now uses explicit wrappers instead of a brutal type cast.

I've taken the opportunity to remove the offset. The wrappers now
perform the offset themselves, by accessing the member field the normal
way (after converting from void*, but that can't be avoided).
src/monocypher.c
src/monocypher.h
src/optional/ed25519.c