mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Replace use of variable-length-arrays.
* common/t-iobuf.c (main): Replace variable-length-array. * g10/gpgcompose.c (mksubpkt_callback): Ditto. (encrypted): Ditto. * g10/t-stutter.c (log_hexdump): Ditto. (oracle_test): Ditto. * g10/tofu.c (get_policy): Ditto. Use "%zu" for size_t. * scd/app-openpgp.c (ecc_writekey): Replace variable-length-array. Check for zero length OID_LEN. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
c52930d11f
commit
6b84ecbf31
5 changed files with 42 additions and 18 deletions
|
@ -2457,16 +2457,16 @@ get_policy (tofu_dbs_t dbs, PKT_public_key *pk,
|
|||
/* See if the key is signed by an ultimately trusted key. */
|
||||
{
|
||||
int fingerprint_raw_len = strlen (fingerprint) / 2;
|
||||
char fingerprint_raw[fingerprint_raw_len];
|
||||
char fingerprint_raw[20];
|
||||
int len = 0;
|
||||
|
||||
if (fingerprint_raw_len != 20
|
||||
if (fingerprint_raw_len != sizeof fingerprint_raw
|
||||
|| ((len = hex2bin (fingerprint,
|
||||
fingerprint_raw, fingerprint_raw_len))
|
||||
!= strlen (fingerprint)))
|
||||
{
|
||||
if (DBG_TRUST)
|
||||
log_debug ("TOFU: Bad fingerprint: %s (len: %zd, parsed: %d)\n",
|
||||
log_debug ("TOFU: Bad fingerprint: %s (len: %zu, parsed: %d)\n",
|
||||
fingerprint, strlen (fingerprint), len);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue