Home GnuPG
Diffusion GnuPG caa555a5bfaa

agent: Fix alignment problem with the second passphrase struct.
caa555a5bfaaUnpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

agent: Fix alignment problem with the second passphrase struct.

* agent/genkey.c (agent_ask_new_passphrase): Use a separate malloc for
PI2.  Check return value of the malloc function.
* agent/command-ssh.c (ssh_identity_register): Use a separate malloc
for PI2.  Wipe PI2.

For whatever stupid reasons I once allocated only one memory area and
split that into PI and PI2. This is actually a common pattern with
malloc but here we used a made up object size and do not take the
extra alignment required into account. One of these not yet hit by
a (sig)bus PC/VAX hacker bugs.

Instead of trying to fix the alignment, it is better to use a second
calloc for the second struct.

Resolved conflicts:
agent/command-ssh.c
agent/genkey.c

(backport master commit ddf9dd135acd2b3635bb986f6dfc0e4e446d5fad)

  • GnuPG-bug-id: T2112
  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Oct 1 2015, 1:21 PM
gniibeCommitted on Oct 5 2015, 7:11 PM
Parents
rGb1653a4083b9: gpg: Silence a compiler warning.
Branches
Unknown
Tags
Unknown

Event Timeline