Check for NULL before dereferencing.
Reported by STACK http://css.csail.mit.edu/stack/ Change-Id: Id7959c8217f46313ecf35a271efaf5f703fde2dc
This commit is contained in:
parent
f09dae493c
commit
1acb4adc3e
|
@ -319,10 +319,11 @@ int sc_lock(sc_card_t *card)
|
|||
{
|
||||
int r = 0, r2 = 0;
|
||||
|
||||
LOG_FUNC_CALLED(card->ctx);
|
||||
|
||||
if (card == NULL)
|
||||
return SC_ERROR_INVALID_ARGUMENTS;
|
||||
|
||||
LOG_FUNC_CALLED(card->ctx);
|
||||
|
||||
r = sc_mutex_lock(card->ctx, card->mutex);
|
||||
if (r != SC_SUCCESS)
|
||||
return r;
|
||||
|
|
Loading…
Reference in New Issue