From 196e476330c7e35c582f162590594b4667a74b0c Mon Sep 17 00:00:00 2001 From: Viktor Tarasov Date: Mon, 7 Mar 2016 18:30:56 +0100 Subject: [PATCH] coverity: check returned value --- src/libopensc/pkcs15-sec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libopensc/pkcs15-sec.c b/src/libopensc/pkcs15-sec.c index af2520d4..34629e98 100644 --- a/src/libopensc/pkcs15-sec.c +++ b/src/libopensc/pkcs15-sec.c @@ -344,8 +344,10 @@ int sc_pkcs15_compute_signature(struct sc_pkcs15_card *p15card, /* revert data to sign when signing with the GOST key. * TODO: can it be confirmed by the GOST standard? * TODO: tested with RuTokenECP, has to be validated for RuToken. */ - if (obj->type == SC_PKCS15_TYPE_PRKEY_GOSTR3410) - sc_mem_reverse(buf, inlen); + if (obj->type == SC_PKCS15_TYPE_PRKEY_GOSTR3410) { + r = sc_mem_reverse(buf, inlen); + LOG_TEST_RET(ctx, r, "Reverse memory error"); + } tmp = buf;