From 16d539041e93c47f17e40637654636dd0d57e452 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Thu, 16 Aug 2018 14:24:15 +0200 Subject: [PATCH] ykpiv: when decoding an object compare lengths correctly the length comparison when reading an object out was messed up, this fixes it to compare correctly. relates #154 --- lib/ykpiv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ykpiv.c b/lib/ykpiv.c index 84d98e2..5006b89 100644 --- a/lib/ykpiv.c +++ b/lib/ykpiv.c @@ -1282,7 +1282,7 @@ ykpiv_rc _ykpiv_fetch_object(ykpiv_state *state, int object_id, if(offs == 0) { return YKPIV_SIZE_ERROR; } - if(outlen > offs + 1 + *len) { + if(outlen + offs + 1 != *len) { if(state->verbose) { fprintf(stderr, "Invalid length indicated in object, total objlen is %lu, indicated length is %lu.", *len, outlen); }