Index: b/agent/agent.h =================================================================== --- b/agent/agent.h +++ b/agent/agent.h @@ -50,7 +50,8 @@ /* The maximum length of a passphrase (in bytes). Note: this is further contrained by the Assuan line length (and any other text on the same line). However, the Assuan line length is 1k bytes so - this shouldn't be a problem in practice. */ + this shouldn't be a problem in practice. + (MAX_PASSPHRASE_LEN + 1) should be multiple of alignment size. */ #define MAX_PASSPHRASE_LEN 255 Index: b/agent/command-ssh.c =================================================================== --- b/agent/command-ssh.c +++ b/agent/command-ssh.c @@ -3107,7 +3107,8 @@ 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) + + MAX_PASSPHRASE_LEN + 1)); pi->max_length = MAX_PASSPHRASE_LEN + 1; pi->max_tries = 1; pi->with_repeat = 1; Index: b/agent/genkey.c =================================================================== --- b/agent/genkey.c +++ b/agent/genkey.c @@ -375,7 +375,8 @@ } pi = gcry_calloc_secure (2, sizeof (*pi) + MAX_PASSPHRASE_LEN + 1); - pi2 = pi + (sizeof *pi + MAX_PASSPHRASE_LEN + 1); + pi2 = (struct pin_entry_info_s *)((char *)pi + (sizeof (*pi) + + MAX_PASSPHRASE_LEN + 1)); pi->max_length = MAX_PASSPHRASE_LEN + 1; pi->max_tries = 3; pi->with_qualitybar = 1;