- in pin_cmd, dont assume the caller has properly initialized max_length and encoding

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1160 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
okir 2003-05-23 10:05:12 +00:00
parent 24107c26f8
commit 484fca5308
1 changed files with 6 additions and 0 deletions

View File

@ -914,6 +914,12 @@ static int flex_pin_cmd(struct sc_card *card, struct sc_pin_cmd_data *data,
int r;
int old_cla = -1;
/* Fix pin data */
data->pin1.encoding = SC_PIN_ENCODING_ASCII;
data->pin1.max_length = 8;
data->pin2.encoding = SC_PIN_ENCODING_ASCII;
data->pin2.max_length = 8;
if (data->cmd == SC_PIN_CMD_VERIFY) {
r = flex_build_verify_apdu(card, &apdu, data);
if (r < 0)