Index: b/agent/command-ssh.c =================================================================== --- b/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -3101,13 +3101,14 @@ goto out; } - pi = gcry_calloc_secure (2, sizeof (*pi) + MAX_PASSPHRASE_LEN + 1); + pi = gcry_calloc_secure (2, sizeof (*pi) - 1 + MAX_PASSPHRASE_LEN + 1); if (!pi) { err = gpg_error_from_syserror (); goto out; } - pi2 = pi + (sizeof *pi + MAX_PASSPHRASE_LEN + 1); + pi2 = (struct pin_entry_info_s *)((char *)pi + (sizeof (*pi) - 1 + + MAX_PASSPHRASE_LEN + 1)); pi->max_length = MAX_PASSPHRASE_LEN + 1; pi->max_tries = 1; pi->with_repeat = 1;