Last change
on this file since 7424 was 7424, checked in by gf, 12 years ago |
Fix use of possibly uninitialised values in readers.
ATR_GetHistoricalBytes() can return without initializing length
parameter so valgrind correctly detects this for each reader:
Conditional jump or move depends on uninitialised value(s)
at 0x80A8A30: conax_card_init (reader-conax.c:117)
by 0x80A6306: reader_get_cardsystem (reader-common.c:210)
by 0x80A640B: reader_reset (reader-common.c:264)
by 0x80563A9: work_thread (oscam.c:4051)
by 0x4060AE9: start_thread (in /lib/libpthread-2.15.so)
by 0x415B69D: clone (in /lib/libc-2.15.so)
|
-
Property svn:eol-style
set to
LF
|
File size:
732 bytes
|
Line | |
---|
1 | #define ADDRLEN 4 // Address length in EMM commands
|
---|
2 | #define MAX_PROV 16
|
---|
3 |
|
---|
4 | //Warning: OK = 0 and ERROR = 1 in csctapi !!!
|
---|
5 | #define SKIPPED 2
|
---|
6 | #define OK 1
|
---|
7 | #define ERROR 0
|
---|
8 | #include "csctapi/atr.h"
|
---|
9 | #define write_cmd(cmd, data) \
|
---|
10 | { \
|
---|
11 | if (card_write(reader, cmd, data, cta_res, &cta_lr)) return ERROR; \
|
---|
12 | }
|
---|
13 |
|
---|
14 | #define get_atr \
|
---|
15 | unsigned char atr[ATR_MAX_SIZE]; \
|
---|
16 | uint32_t atr_size; \
|
---|
17 | memset(atr, 0, sizeof(atr)); \
|
---|
18 | ATR_GetRaw(newatr, atr, &atr_size);
|
---|
19 |
|
---|
20 | #define get_hist \
|
---|
21 | unsigned char hist[ATR_MAX_HISTORICAL]; \
|
---|
22 | uint32_t hist_size = 0; \
|
---|
23 | ATR_GetHistoricalBytes(newatr, hist, &hist_size);
|
---|
24 |
|
---|
25 | #define def_resp \
|
---|
26 | unsigned char cta_res[CTA_RES_LEN]; \
|
---|
27 | memset(cta_res, 0, CTA_RES_LEN); \
|
---|
28 | uint16_t cta_lr;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.