Skip to content

Commit

Permalink
Fix a bug previous in the previous patch
Browse files Browse the repository at this point in the history
** CID 1598411:  Control flow issues  (MISSING_RESTORE)
/src/commands.c: 536 in SecurePINVerify()

________________________________________________________________________________________________________
*** CID 1598411:  Control flow issues  (MISSING_RESTORE)
/src/commands.c: 536 in SecurePINVerify()
530                             #define T1_S_RESPONSE           0x20
531                             #define T1_S_TYPE(pcb)          ((pcb) & 0x0F)
532                             #define T1_S_WTX                0x03
533
534                             /* this should not happen. It will make coverity happy */
535                             if (*RxLength < 4)
>>>     CID 1598411:  Control flow issues  (MISSING_RESTORE)
>>>     Value of non-local "ccid_descriptor->readTimeout" that was saved in "old_read_timeout" is not restored as it was along other paths.
536                                     return IFD_COMMUNICATION_ERROR;
537
538                             /* WTX S-block */
539                             if ((T1_S_BLOCK | T1_S_WTX) == RxBuffer[PCB])
540                             {
541     /*
  • Loading branch information
LudovicRousseau committed May 21, 2024
1 parent 346c3aa commit 46de93d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,10 @@ RESPONSECODE SecurePINVerify(unsigned int reader_index,

/* this should not happen. It will make coverity happy */
if (*RxLength < 4)
return IFD_COMMUNICATION_ERROR;
{
ret = IFD_COMMUNICATION_ERROR;
goto end;
}

/* WTX S-block */
if ((T1_S_BLOCK | T1_S_WTX) == RxBuffer[PCB])
Expand Down

0 comments on commit 46de93d

Please sign in to comment.