You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pass a ByteArray as the return buffer instead of String in #hexString.
Using a String works in Squeak FFI as the result is guaranteed to be ascii, but it is bad practice in general.
In Threaded FFI Strings are utf8 encoded and then passed in a buffer that is discarded after the call completes, i.e. they can't be used to return values (which is good since the decoding hasn't been done).
Use git_oid_nfmt() instead of git_oid_fmt(). The latter is suspectable to buffer overruns, which will corrupt object memory.
As implied in the first point above, this change is a pre-requisite for using LibGit with threaded FFI due to the improvement in string handling.
LGitId>>hexString proposed improvements:
Using a String works in Squeak FFI as the result is guaranteed to be ascii, but it is bad practice in general.
In Threaded FFI Strings are utf8 encoded and then passed in a buffer that is discarded after the call completes, i.e. they can't be used to return values (which is good since the decoding hasn't been done).
As implied in the first point above, this change is a pre-requisite for using LibGit with threaded FFI due to the improvement in string handling.
PR: pharo-vcs/libgit2-pharo-bindings#31
The text was updated successfully, but these errors were encountered: