Skip to content

Commit 895ce6f

Browse files
committed
x509name: do not check for negative return from X509_NAME_entry_count()
The function never returns a negative number.
1 parent 5164725 commit 895ce6f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ext/openssl/ossl_x509name.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,7 @@ ossl_x509name_to_a(VALUE self)
354354

355355
GetX509Name(self, name);
356356
entries = X509_NAME_entry_count(name);
357-
if (entries < 0) {
358-
OSSL_Debug("name entries < 0!");
359-
return rb_ary_new();
360-
}
361-
ret = rb_ary_new2(entries);
357+
ret = rb_ary_new_capa(entries);
362358
for (i=0; i<entries; i++) {
363359
if (!(entry = X509_NAME_get_entry(name, i))) {
364360
ossl_raise(eX509NameError, NULL);

0 commit comments

Comments
 (0)