From 340177f070440dd60261a7d44c1697f7ae9c4341 Mon Sep 17 00:00:00 2001 From: Dave Pate Date: Thu, 17 Jan 2019 15:49:21 -0800 Subject: [PATCH] lib: check that serial/version checks occur during select --- lib/ykpiv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ykpiv.c b/lib/ykpiv.c index 2c640a9..2e416ce 100644 --- a/lib/ykpiv.c +++ b/lib/ykpiv.c @@ -291,8 +291,8 @@ ykpiv_rc _ykpiv_select_application(ykpiv_state *state) { * can determine how to get the serial number, which for the NEO/Yk4 * will result in another selection of the PIV applet. */ - _ykpiv_get_version(state, NULL); - _ykpiv_get_serial(state, NULL, false); + res = _ykpiv_get_version(state, NULL); + if (res == YKPIV_OK) res = _ykpiv_get_serial(state, NULL, false); return res; }