FreeCalypso > hg > fc-pcsc-tools
comparison simtool/select.c @ 79:b0982c0cf54d
EF select logic: detect invalid record count > 255
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Wed, 17 Feb 2021 05:21:34 +0000 |
| parents | 2071b28cd0c7 |
| children | be1a759453ef |
comparison
equal
deleted
inserted
replaced
| 78:702c2c40e51a | 79:b0982c0cf54d |
|---|---|
| 210 fprintf(stderr, | 210 fprintf(stderr, |
| 211 "error: returned file size is not divisible by record length\n"); | 211 "error: returned file size is not divisible by record length\n"); |
| 212 return(-1); | 212 return(-1); |
| 213 } | 213 } |
| 214 curfile_record_count = curfile_total_size / curfile_record_len; | 214 curfile_record_count = curfile_total_size / curfile_record_len; |
| 215 if (curfile_record_count > 255) { | |
| 216 fprintf(stderr, | |
| 217 "error: EF record count exceeds protocol limit\n"); | |
| 218 return(-1); | |
| 219 } | |
| 215 break; | 220 break; |
| 216 default: | 221 default: |
| 217 fprintf(stderr, "error: unknown EF structure code %02X\n", | 222 fprintf(stderr, "error: unknown EF structure code %02X\n", |
| 218 curfile_structure); | 223 curfile_structure); |
| 219 return(-1); | 224 return(-1); |
