1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

Fixed a bunch of little bugs as reported by Fabian Keil.

Still one problem left; marked with a gcc #warning.
This commit is contained in:
Werner Koch 2009-06-24 14:03:09 +00:00
parent e05aeca87b
commit 2e0ce7d97f
23 changed files with 79 additions and 29 deletions

View file

@ -1,3 +1,15 @@
2009-06-24 Werner Koch <wk@g10code.com>
* keyedit.c (menu_select_key): Renmove dead assign to I.
(menu_select_uid): Ditto.
* keyring.c (keyring_search): Remove dead assign to NAME.
* card-util.c (card_edit): Remove useless DID_CHECKPIN.
* call-agent.c (unhexify_fpr): Remove dead op on N.
* passphrase.c (passphrase_to_dek_ext): Do not deref a NULL PW.
* revoke.c (gen_revoke): Remove unused malloc of PK.
* parse-packet.c (mpi_read): Init NREAD.
Reported by Fabian Keil.
2009-06-17 Werner Koch <wk@g10code.com>
* parse-packet.c (parse): Use a casted -1 instead of a 32 bit

View file

@ -132,7 +132,6 @@ unhexify_fpr (const char *hexstr, unsigned char *fpr)
;
if (*s || (n != 40))
return 0; /* no fingerprint (invalid or wrong length). */
n /= 2;
for (s=hexstr, n=0; *s; s += 2, n++)
fpr[n] = xtoi_2 (s);
return 1; /* okay */

View file

@ -1600,7 +1600,7 @@ card_edit (strlist_t commands)
int have_commands = !!commands;
int redisplay = 1;
char *answer = NULL;
int did_checkpin = 0, allow_admin=0;
int allow_admin=0;
char serialnobuf[50];
@ -1812,12 +1812,10 @@ card_edit (strlist_t commands)
case cmdPASSWD:
change_pin (0, allow_admin);
did_checkpin = 0; /* Need to reset it of course. */
break;
case cmdUNBLOCK:
change_pin (1, allow_admin);
did_checkpin = 0; /* Need to reset it of course. */
break;
case cmdQUIT:

View file

@ -4458,7 +4458,7 @@ menu_select_uid( KBNODE keyblock, int idx )
}
}
else { /* reset all */
for( i=0, node = keyblock; node; node = node->next ) {
for (node = keyblock; node; node = node->next) {
if( node->pkt->pkttype == PKT_USER_ID )
node->flag &= ~NODFLG_SELUID;
}
@ -4543,7 +4543,7 @@ menu_select_key( KBNODE keyblock, int idx )
}
}
else { /* reset all */
for( i=0, node = keyblock; node; node = node->next ) {
for ( node = keyblock; node; node = node->next ) {
if( node->pkt->pkttype == PKT_PUBLIC_SUBKEY
|| node->pkt->pkttype == PKT_SECRET_SUBKEY )
node->flag &= ~NODFLG_SELKEY;

View file

@ -997,7 +997,7 @@ keyring_search (KEYRING_HANDLE hd, KEYDB_SEARCH_DESC *desc,
hd->word_match.name = xstrdup (name);
hd->word_match.pattern = prepare_word_match (name);
}
name = hd->word_match.pattern;
/* name = hd->word_match.pattern; */
}
init_packet(&pkt);

View file

@ -112,7 +112,7 @@ mpi_read (iobuf_t inp, unsigned int *ret_nread, int secure)
int c, c1, c2, i;
unsigned int nbits, nbytes;
size_t nread;
size_t nread = 0;
gcry_mpi_t a = NULL;
byte *buf = NULL;
byte *p;

View file

@ -600,7 +600,7 @@ passphrase_to_dek_ext (u32 *keyid, int pubkey_algo,
get_last_passphrase(). */
dek = xmalloc_secure_clear ( sizeof *dek );
dek->algo = cipher_algo;
if ( !*pw && (mode == 2 || mode == 4))
if ( (!pw || !*pw) && (mode == 2 || mode == 4))
dek->keylen = 0;
else
hash_passphrase (dek, pw, s2k);

View file

@ -489,8 +489,6 @@ gen_revoke( const char *uname )
keyid_from_sk( sk, sk_keyid );
print_seckey_info (sk);
pk = xmalloc_clear( sizeof *pk );
/* FIXME: We should get the public key direct from the secret one */
pub_keyblock=get_pubkeyblock(sk_keyid);