Fix potential cache corruption on command failure.
commit0780baa1e351ec26cc6874905a0c8d2b2a673d4f
authorBen Kibbey <bjk@luxsci.net>
Tue, 21 Apr 2015 01:25:15 +0000 (20 21:25 -0400)
committerBen Kibbey <bjk@luxsci.net>
Tue, 21 Apr 2015 02:04:07 +0000 (20 22:04 -0400)
treeaa904198177a0eaec88edf6abfa5870f0d9b517b
parentb291296a929cf591582630e8d70fe9a4c64d685a
Fix potential cache corruption on command failure.

Don't update the cached key until the encrypt operation completes and
duplicate the passed key to save_common() to prevent a dangling pointer
in the cache.
src/agent.c
src/commands.c
src/crypto.c