CID 320271 (#1 of 1): Dereference before null check (REVERSE_INULL)
This commit is contained in:
parent
3c0a16dc39
commit
c032b2f15d
|
@ -396,8 +396,6 @@ pkcs15_init_token_info(struct sc_pkcs15_card *p15card, CK_TOKEN_INFO_PTR pToken)
|
||||||
scconf_block *conf_block = NULL;
|
scconf_block *conf_block = NULL;
|
||||||
char *model = NULL;
|
char *model = NULL;
|
||||||
|
|
||||||
strcpy_bp(pToken->manufacturerID, p15card->tokeninfo->manufacturer_id, 32);
|
|
||||||
|
|
||||||
conf_block = sc_get_conf_block(p15card->card->ctx, "framework", "pkcs15", 1);
|
conf_block = sc_get_conf_block(p15card->card->ctx, "framework", "pkcs15", 1);
|
||||||
if (conf_block && p15card->file_app) {
|
if (conf_block && p15card->file_app) {
|
||||||
scconf_block **blocks = NULL;
|
scconf_block **blocks = NULL;
|
||||||
|
@ -420,6 +418,9 @@ pkcs15_init_token_info(struct sc_pkcs15_card *p15card, CK_TOKEN_INFO_PTR pToken)
|
||||||
else
|
else
|
||||||
strcpy_bp(pToken->model, "PKCS#15", sizeof(pToken->model));
|
strcpy_bp(pToken->model, "PKCS#15", sizeof(pToken->model));
|
||||||
|
|
||||||
|
if (p15card->tokeninfo) {
|
||||||
|
strcpy_bp(pToken->manufacturerID, p15card->tokeninfo->manufacturer_id, 32);
|
||||||
|
|
||||||
/* Take the last 16 chars of the serial number (if the are more than 16).
|
/* Take the last 16 chars of the serial number (if the are more than 16).
|
||||||
* _Assuming_ that the serial number is a Big Endian counter, this
|
* _Assuming_ that the serial number is a Big Endian counter, this
|
||||||
* will assure that the serial within each type of card will be
|
* will assure that the serial within each type of card will be
|
||||||
|
@ -434,6 +435,7 @@ pkcs15_init_token_info(struct sc_pkcs15_card *p15card, CK_TOKEN_INFO_PTR pToken)
|
||||||
|
|
||||||
strcpy_bp(pToken->serialNumber, p15card->tokeninfo->serial_number + sn_start, 16);
|
strcpy_bp(pToken->serialNumber, p15card->tokeninfo->serial_number + sn_start, 16);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pToken->ulMaxSessionCount = CK_EFFECTIVELY_INFINITE;
|
pToken->ulMaxSessionCount = CK_EFFECTIVELY_INFINITE;
|
||||||
pToken->ulSessionCount = 0; /* FIXME */
|
pToken->ulSessionCount = 0; /* FIXME */
|
||||||
|
|
Loading…
Reference in New Issue