On 8/18/2011 9:26 AM, Martin Paljak wrote:
> Hello,
>
> On Wed, Aug 17, 2011 at 23:39, Douglas E. Engert<deeng...@anl.gov>  wrote:
>
>> --- a/src/libopensc/card-gemsafeV1.c
>> +++ b/src/libopensc/card-gemsafeV1.c
>> @@ -172,6 +172,7 @@ static int gemsafe_init(struct sc_card *card)
>>          /* SELECT applet */
>>          r = gp_select_applet(card, exdata->aid, exdata->aid_len);
>>          if (r<  0) {
>> +               card->lock_count--;
>>                  free(exdata);
>>                  sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "applet selection 
>> failed\n");
>>                  return SC_ERROR_INTERNAL;
>
> sc_lock/sc_unlock should be used instead of direct modification.

The patch was in the spirit of the current code, that already does
card->lock_count++; before this, and card->lock_count--; after this.

sc_lock/sc_unlock appears to be a better way. I don't know why it was
not used in the first place. I have no way to test this code, just
pointing out what appears to be the problem.

>
> Best,
> Martin
>
>

-- 

  Douglas E. Engert  <deeng...@anl.gov>
  Argonne National Laboratory
  9700 South Cass Avenue
  Argonne, Illinois  60439
  (630) 252-5444
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to