pygit2 icon indicating copy to clipboard operation
pygit2 copied to clipboard

Fix Signature repr()

Open JacobSwanson opened this issue 3 years ago • 0 comments

to_unicode() expects a non-NULL x argument (due to strlen(x)); however self->encoding may be NULL, especially if built with build_signature() (i.e. if called from the commit.author property).

As a result, any repr() on a Signature with a NULL encoding will cause a segfault.

Other functions manually map NULL to "utf-8" (see Signature__encoding__get__()), so we'll do the same thing here.

JacobSwanson avatar Aug 14 '22 23:08 JacobSwanson