Skip to content

Commit

Permalink
x509name: do not check for negative return from X509_NAME_entry_count()
Browse files Browse the repository at this point in the history
The function never returns a negative number.
  • Loading branch information
rhenium committed Feb 11, 2025
1 parent 5164725 commit 895ce6f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ext/openssl/ossl_x509name.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,7 @@ ossl_x509name_to_a(VALUE self)

GetX509Name(self, name);
entries = X509_NAME_entry_count(name);
if (entries < 0) {
OSSL_Debug("name entries < 0!");
return rb_ary_new();
}
ret = rb_ary_new2(entries);
ret = rb_ary_new_capa(entries);
for (i=0; i<entries; i++) {
if (!(entry = X509_NAME_get_entry(name, i))) {
ossl_raise(eX509NameError, NULL);
Expand Down

0 comments on commit 895ce6f

Please sign in to comment.