]> git.ipfire.org Git - thirdparty/qemu.git/commit
libcacard: don't free sign buffer while sign op is pending
authorRay Strode <rstrode@redhat.com>
Sun, 19 Oct 2014 02:12:49 +0000 (22:12 -0400)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Wed, 7 Jan 2015 00:13:49 +0000 (18:13 -0600)
commit90de7a03bbc24d559971248c5530631d9bc27250
tree4ede56ab707db5f73215dc3e341426e3e2810fab
parent57248587af8090ca0bc7bd0cd672ff15e2ebf8b9
libcacard: don't free sign buffer while sign op is pending

commit 57f97834efe0c208ffadc9d2959f3d3d55580e52 cleaned up
the cac_applet_pki_process_apdu function to have a single
exit point. Unfortunately, that commit introduced a bug
where the sign buffer can get free'd and nullified while
it's still being used.

This commit corrects the bug by introducing a boolean to
track whether or not the sign buffer should be freed in
the function exit path.

Signed-off-by: Ray Strode <rstrode@redhat.com>
Reviewed-by: Alon Levy <alon@pobox.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 81b49e8f892a977f3821f3416ea51aa641d63ac4)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
libcacard/cac.c