HomePhabricator

dh-gex: fix double-ssh_dh_init_common memory leak

Authored by simonsj on Jan 30 2019, 2:06 AM.

Description

dh-gex: fix double-ssh_dh_init_common memory leak

Fix a memory leak whereby the x, y, and k bignum fields within
a session's next_crypto structure were being unintentionally
initialized twice.

The leak can be seen before the fix with valgrind and the pkd
tests with:

valgrind \
  --leak-check=full \
  --show-leak-kinds=definite \
  ./pkd_hello -i1 -t torture_pkd_openssh_rsa_rsa_diffie_hellman_group_exchange_sha256

Signed-off-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>

Details

Committed
asnJan 30 2019, 1:22 PM
Parents
rLIBSSH886681a42131: dh-gex: fix moduli file stream leak
Branches
Unknown
Tags
Unknown