diff options
author | Werner Koch <wk@gnupg.org> | 2017-01-02 13:29:18 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2017-01-02 13:29:18 +0100 |
commit | 6b84ecbf312d98ac8cce9fe5facdc815bc742fa1 (patch) | |
tree | a607006cafbc14a6d52a054ee1a2b5d77f435d5c /g10/tofu.c | |
parent | build: Enable gcc warnings to detect non-portable code. (diff) | |
download | gnupg2-6b84ecbf312d98ac8cce9fe5facdc815bc742fa1.tar.xz gnupg2-6b84ecbf312d98ac8cce9fe5facdc815bc742fa1.zip |
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>
Diffstat (limited to 'g10/tofu.c')
-rw-r--r-- | g10/tofu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/g10/tofu.c b/g10/tofu.c index 2bded9e8d..8d535fa6c 100644 --- a/g10/tofu.c +++ b/g10/tofu.c @@ -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 |