avoid NULL dereference

This commit is contained in:
Frank Morgner 2018-06-21 14:41:13 +02:00
parent ed0d829eab
commit 03c5280626
1 changed files with 3 additions and 1 deletions

View File

@ -345,7 +345,9 @@ static int gids_get_DO(sc_card_t* card, int fileIdentifier, int dataObjectIdenti
if (datasize > *responselen) {
return SC_ERROR_BUFFER_TOO_SMALL;
}
memcpy(response, p, datasize);
if (response) {
memcpy(response, p, datasize);
}
*responselen = datasize;
return SC_SUCCESS;
}