- sm.c: added test for available memory

- npa.c: removed obsolete comments


git-svn-id: https://vsmartcard.svn.sourceforge.net/svnroot/vsmartcard@421 96b47cad-a561-4643-ad3b-153ac7d7599c
This commit is contained in:
frankmorgner
2011-05-20 08:44:20 +00:00
parent e378d28e21
commit 6fdd7bf560
2 changed files with 3 additions and 19 deletions

View File

@@ -528,7 +528,7 @@ static int sm_decrypt(const struct sm_ctx *ctx, sc_card_t *card,
goto err;
}
if (apdu->resplen < r) {
if (apdu->resplen < r || (r && !apdu->resp)) {
sc_debug(card->ctx, SC_LOG_DEBUG_VERBOSE, "Response of SM APDU too long");
r = SC_ERROR_OUT_OF_MEMORY;
goto err;