prevent integer overflow

This commit is contained in:
Frank Morgner 2017-06-06 00:45:18 +02:00
parent 7e5afad630
commit 888215ca7c
1 changed files with 1 additions and 1 deletions

View File

@ -1270,7 +1270,7 @@ sc_pkcs15_read_der_file(sc_context_t *ctx, char * filename,
}
offs = body - tagbuf;
if (offs > len || offs < 2) {
if (offs > len || offs < 2 || offs > offs + bodylen) {
r = SC_ERROR_INVALID_ASN1_OBJECT;
goto out;
}