mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-17 14:07:03 +01:00
card: Fix a NULL-ptr deref in key listings.
* tools/card-tool-keys.c (get_matching_keys): Fix segv. * tools/gpg-card-tool.c (main): Init info. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
5bf1212000
commit
df6ba6dfd2
@ -214,9 +214,12 @@ get_matching_keys (const unsigned char *keygrip, int protocol,
|
||||
err = get_matching_keys (keygrip, GNUPG_PROTOCOL_OPENPGP, &kb);
|
||||
if (!err || gpg_err_code (err) == GPG_ERR_NO_PUBKEY)
|
||||
{
|
||||
*keyblock_tail = kb;
|
||||
keyblock_tail = &kb->next;
|
||||
kb = NULL;
|
||||
if (!err)
|
||||
{
|
||||
*keyblock_tail = kb;
|
||||
keyblock_tail = &kb->next;
|
||||
kb = NULL;
|
||||
}
|
||||
err = get_matching_keys (keygrip, GNUPG_PROTOCOL_CMS, &kb);
|
||||
if (!err)
|
||||
{
|
||||
|
@ -309,7 +309,7 @@ main (int argc, char **argv)
|
||||
}
|
||||
else
|
||||
{
|
||||
struct card_info_s info_buffer;
|
||||
struct card_info_s info_buffer = { 0 };
|
||||
card_info_t info = &info_buffer;
|
||||
|
||||
err = 0;
|
||||
@ -2968,7 +2968,7 @@ interactive_loop (void)
|
||||
int redisplay = 1; /* Whether to redisplay the main info. */
|
||||
int allow_admin = 0; /* Whether admin commands are allowed. */
|
||||
char *help_arg = NULL; /* Argument of the HELP command. */
|
||||
struct card_info_s info_buffer;
|
||||
struct card_info_s info_buffer = { 0 };
|
||||
card_info_t info = &info_buffer;
|
||||
char *p;
|
||||
int i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user