diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2018-03-31 21:09:32 +0200 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2018-04-03 16:05:49 +0200 |
commit | 477e40b48c5a2d5f9ba597cea2f2e2eb77e9347a (patch) | |
tree | 6a167e6a84acd05ce34db659046fc000bff3644d /apps | |
parent | 6a285edd520f9508efb76f30aff9812ce7115fa8 (diff) |
Fix a crash in the asn1parse command
Thanks to Sem Voigtländer for reporting this issue.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/5826)
(cherry picked from commit 752837e0664e990b5edf6f0b69e1b4612efadce0)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/asn1pars.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/asn1pars.c b/apps/asn1pars.c index 0a6b990b50..55ecd7cab0 100644 --- a/apps/asn1pars.c +++ b/apps/asn1pars.c @@ -295,7 +295,7 @@ int MAIN(int argc, char **argv) ASN1_TYPE *atmp; int typ; j = atoi(sk_OPENSSL_STRING_value(osk, i)); - if (j == 0) { + if (j <= 0 || j >= tmplen) { BIO_printf(bio_err, "'%s' is an invalid number\n", sk_OPENSSL_STRING_value(osk, i)); continue; |