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
|
@ -68,8 +68,8 @@ log_hexdump (byte *buffer, int length)
|
|||
{
|
||||
int have = length > 16 ? 16 : length;
|
||||
int i;
|
||||
char formatted[2 * have + 1];
|
||||
char text[have + 1];
|
||||
char formatted[2 * 16 + 1];
|
||||
char text[16 + 1];
|
||||
|
||||
fprintf (stderr, "%-8d ", written);
|
||||
bin2hex (buffer, have, formatted);
|
||||
|
@ -87,10 +87,12 @@ log_hexdump (byte *buffer, int length)
|
|||
}
|
||||
|
||||
for (i = 0; i < have; i ++)
|
||||
if (isprint (buffer[i]))
|
||||
text[i] = buffer[i];
|
||||
else
|
||||
text[i] = '.';
|
||||
{
|
||||
if (isprint (buffer[i]))
|
||||
text[i] = buffer[i];
|
||||
else
|
||||
text[i] = '.';
|
||||
}
|
||||
text[i] = 0;
|
||||
|
||||
fprintf (stderr, " ");
|
||||
|
@ -347,8 +349,9 @@ oracle (int debug, byte *ciphertext, int len, byte **plaintextp, byte **cfbp)
|
|||
static int
|
||||
oracle_test (unsigned int d, int b, int debug)
|
||||
{
|
||||
byte probe[blocksize + 2];
|
||||
byte probe[32 + 2];
|
||||
|
||||
log_assert (blocksize + 2 <= sizeof probe);
|
||||
log_assert (d < 256 * 256);
|
||||
|
||||
if (b == 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue