Skip to content

Commit

Permalink
ccid_open_hack_pre(): fix bug for ICCD type A & B devices
Browse files Browse the repository at this point in the history
The CmdPowerOn() used a wrong value for voltage selection.

Thanks to Coverity:
CID 1453380 (#2 of 2): Out-of-bounds access (OVERRUN)
6. overrun-call: Overrunning callee's array of size 4 by passing
argument 8 in call to CmdPowerOn.
  • Loading branch information
LudovicRousseau committed Sep 1, 2019
1 parent d8eec80 commit 4c11649
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ccid.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int ccid_open_hack_pre(unsigned int reader_index)

DEBUG_COMM("ICCD type A");
(void)CmdPowerOff(reader_index);
(void)CmdPowerOn(reader_index, &n, tmp, CCID_CLASS_AUTO_VOLTAGE);
(void)CmdPowerOn(reader_index, &n, tmp, VOLTAGE_AUTO);
(void)CmdPowerOff(reader_index);
}

Expand All @@ -142,7 +142,7 @@ int ccid_open_hack_pre(unsigned int reader_index)
}

(void)CmdPowerOff(reader_index);
(void)CmdPowerOn(reader_index, &n, tmp, CCID_CLASS_AUTO_VOLTAGE);
(void)CmdPowerOn(reader_index, &n, tmp, VOLTAGE_AUTO);
(void)CmdPowerOff(reader_index);
}

Expand Down

0 comments on commit 4c11649

Please sign in to comment.