diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/asn1pars.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/asn1pars.c b/apps/asn1pars.c index 55ecd7cab0..6e7ed289d5 100644 --- a/apps/asn1pars.c +++ b/apps/asn1pars.c @@ -327,14 +327,14 @@ int MAIN(int argc, char **argv) num = tmplen; } - if (offset >= num) { + if (offset < 0 || offset >= num) { BIO_printf(bio_err, "Error: offset too large\n"); goto end; } num -= offset; - if ((length == 0) || ((long)length > num)) + if (length == 0 || length > (unsigned int)num) length = (unsigned int)num; if (derout) { if (BIO_write(derout, str + offset, length) != (int)length) { |