Skip to content
Permalink
Browse files Browse the repository at this point in the history
tcos: prevent out of bounds read
  • Loading branch information
Jakuje committed Dec 4, 2020
1 parent 3ffe24c commit 78cdab9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libopensc/pkcs15-tcos.c
Expand Up @@ -152,7 +152,7 @@ static int insert_key(
sc_log(ctx, "No EF_KEYD-Record found\n");
return 1;
}
for (i = 0; i < r; i += 2 + buf[i + 1]) {
for (i = 0; i + 1 < r; i += 2 + buf[i + 1]) {
if (buf[i] == 0xB6)
can_sign++;
if (buf[i] == 0xB8)
Expand Down

0 comments on commit 78cdab9

Please sign in to comment.