mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17: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
@ -213,10 +213,13 @@ get_matching_keys (const unsigned char *keygrip, int protocol,
|
|||||||
{
|
{
|
||||||
err = get_matching_keys (keygrip, GNUPG_PROTOCOL_OPENPGP, &kb);
|
err = get_matching_keys (keygrip, GNUPG_PROTOCOL_OPENPGP, &kb);
|
||||||
if (!err || gpg_err_code (err) == GPG_ERR_NO_PUBKEY)
|
if (!err || gpg_err_code (err) == GPG_ERR_NO_PUBKEY)
|
||||||
|
{
|
||||||
|
if (!err)
|
||||||
{
|
{
|
||||||
*keyblock_tail = kb;
|
*keyblock_tail = kb;
|
||||||
keyblock_tail = &kb->next;
|
keyblock_tail = &kb->next;
|
||||||
kb = NULL;
|
kb = NULL;
|
||||||
|
}
|
||||||
err = get_matching_keys (keygrip, GNUPG_PROTOCOL_CMS, &kb);
|
err = get_matching_keys (keygrip, GNUPG_PROTOCOL_CMS, &kb);
|
||||||
if (!err)
|
if (!err)
|
||||||
{
|
{
|
||||||
|
@ -309,7 +309,7 @@ main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
struct card_info_s info_buffer;
|
struct card_info_s info_buffer = { 0 };
|
||||||
card_info_t info = &info_buffer;
|
card_info_t info = &info_buffer;
|
||||||
|
|
||||||
err = 0;
|
err = 0;
|
||||||
@ -2968,7 +2968,7 @@ interactive_loop (void)
|
|||||||
int redisplay = 1; /* Whether to redisplay the main info. */
|
int redisplay = 1; /* Whether to redisplay the main info. */
|
||||||
int allow_admin = 0; /* Whether admin commands are allowed. */
|
int allow_admin = 0; /* Whether admin commands are allowed. */
|
||||||
char *help_arg = NULL; /* Argument of the HELP command. */
|
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;
|
card_info_t info = &info_buffer;
|
||||||
char *p;
|
char *p;
|
||||||
int i;
|
int i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user