Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Key Generation (CLI): Conditional jump or move depends on uninitialised value(s) #2294

Open
TJ-91 opened this issue Nov 28, 2024 · 1 comment

Comments

@TJ-91
Copy link
Contributor

TJ-91 commented Nov 28, 2024

When generating a key via CLI, for example via ./src/rnpkeys/rnpkeys -g, valgrind reports

==1715== Conditional jump or move depends on uninitialised value(s)
==1715==    at 0x20AE47: rnp::CertParams::populate(pgp_signature_t&) const (keygen.cpp:483)
==1715==    by 0x20AFBB: rnp::CertParams::populate(pgp_userid_pkt_t&, pgp_signature_t&) const (keygen.cpp:529)
==1715==    by 0x218FA0: pgp_key_t::add_uid_cert(rnp::CertParams&, pgp_hash_alg_t, rnp::SecurityContext&, pgp_key_t*) (pgp-key.cpp:2547)
==1715==    by 0x2099D7: rnp::KeygenParams::generate(rnp::CertParams&, pgp_key_t&, pgp_key_t&, pgp_key_store_format_t) (keygen.cpp:275)
==1715==    by 0x240236: rnp_op_generate_execute (rnp.cpp:5525)
==1715==    by 0x168B28: cli_rnp_generate_key(cli_rnp_t*, char const*) (fficli.cpp:1612)
==1715==    by 0x126361: rnp_cmd(cli_rnp_t*, optdefs_t, char const*) (rnpkeys.cpp:429)
==1715==    by 0x12E670: main (main.cpp:129)

The line in question is if (primary) { where the CertParams::primary variable is used.

It could be set in rnp_op_generate_execute() to the value of op->primary (which itself is set in rnp_op_generate_create() and rnp_op_generate_subkey_create()).

@ni4
Copy link
Contributor

ni4 commented Nov 28, 2024

Thanks for reporting! Seems valgrind sometimes detect issues which sanitizers/static analysis cannot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants