Skip to content

Commit

Permalink
cert: Avoid use of uninitialized memory on errors
Browse files Browse the repository at this point in the history
Thanks oss-fuzz and deengert for pointing the issue out.

This issue was introduced in
460a862

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66192
  • Loading branch information
Jakuje committed May 14, 2024
1 parent 42d4950 commit e4d2c99
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libopensc/pkcs15-cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static int
parse_x509_cert(sc_context_t *ctx, struct sc_pkcs15_der *der, struct sc_pkcs15_cert *cert)
{
int r;
struct sc_algorithm_id sig_alg;
struct sc_algorithm_id sig_alg = {0};
struct sc_pkcs15_pubkey *pubkey = NULL;
unsigned char *serial = NULL, *issuer = NULL, *subject = NULL, *buf = der->value;
size_t serial_len = 0, issuer_len = 0, subject_len = 0, data_len = 0, buflen = der->len;
Expand Down

0 comments on commit e4d2c99

Please sign in to comment.