also check that priv->p15card is not NULL.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2723 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
parent
4bac6634a1
commit
ad844b0f74
|
@ -58,7 +58,7 @@ static int sc_private_decrypt(int flen, const unsigned char *from, unsigned char
|
|||
if (priv->p15card == NULL) {
|
||||
sc_close(priv);
|
||||
r = sc_init(priv);
|
||||
if (r) {
|
||||
if (r || priv->p15card == NULL) {
|
||||
DBG(printf("smart card init failed: %s", sc_strerror(r)));
|
||||
goto err;
|
||||
}
|
||||
|
@ -121,7 +121,7 @@ sc_sign(int type, const unsigned char *m, unsigned int m_len,
|
|||
if (priv->p15card == NULL) {
|
||||
sc_close(priv);
|
||||
r = sc_init(priv);
|
||||
if (r) {
|
||||
if (r || priv->p15card == NULL) {
|
||||
DBG(printf("smart card init failed: %s", sc_strerror(r)));
|
||||
goto err;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue