Fix a real bug (and a compiler warning)
pkcs15-oberthur.c: In function 'sc_pkcs15emu_oberthur_add_pubkey': pkcs15-oberthur.c:585: warning: statement with no effect pkcs15-oberthur.c: In function 'sc_pkcs15emu_oberthur_add_cert': pkcs15-oberthur.c:654: warning: statement with no effect git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5269 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
04154504a1
commit
fe630c884f
|
@ -582,7 +582,8 @@ sc_pkcs15emu_oberthur_add_pubkey(struct sc_pkcs15_card *p15card,
|
|||
SC_TEST_RET(ctx, SC_LOG_DEBUG_NORMAL, SC_ERROR_UNKNOWN_DATA_RECEIVED, "Failed to add public key: no 'Label'");
|
||||
len = *(info_blob + offs + 1) + *(info_blob + offs) * 0x100;
|
||||
if (len) {
|
||||
len > sizeof(key_obj.label) - 1 ? sizeof(key_obj.label) - 1 : len;
|
||||
if (len > sizeof(key_obj.label) - 1)
|
||||
len = sizeof(key_obj.label) - 1;
|
||||
memcpy(key_obj.label, info_blob + offs + 2, len);
|
||||
}
|
||||
offs += 2 + len;
|
||||
|
@ -651,7 +652,8 @@ sc_pkcs15emu_oberthur_add_cert(struct sc_pkcs15_card *p15card, unsigned int file
|
|||
SC_TEST_RET(ctx, SC_LOG_DEBUG_NORMAL, SC_ERROR_UNKNOWN_DATA_RECEIVED, "Failed to add certificate: no 'CN'");
|
||||
len = *(info_blob + offs + 1) + *(info_blob + offs) * 0x100;
|
||||
if (len) {
|
||||
len > sizeof(cobj.label) - 1 ? sizeof(cobj.label) - 1 : len;
|
||||
if (len > sizeof(cobj.label) - 1)
|
||||
len = sizeof(cobj.label) - 1;
|
||||
memcpy(cobj.label, info_blob + offs + 2, len);
|
||||
}
|
||||
offs += 2 + len;
|
||||
|
|
Loading…
Reference in New Issue