Skip to content

Commit aa04bf0

Browse files
authored
fix(pcsc): ensure part_name is not NULL before checking reader (#403)
1 parent 44e85ab commit aa04bf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

driver/apdu/pcsc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int pcsc_open_hCard_iter(struct pcsc_userdata *userdata, const int index,
118118
const int id = getenv_or_default(ENV_DRV_IFID, (int)-1);
119119
if (id != -1 && id != index) {
120120
const char *part_name = getenv(ENV_DRV_NAME);
121-
if (strstr(reader, part_name) == NULL) {
121+
if (part_name != NULL && strstr(reader, part_name) == NULL) {
122122
return 0;
123123
}
124124
}

0 commit comments

Comments
 (0)