aboutsummaryrefslogtreecommitdiffstats
path: root/apps/x509.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-01-30 15:39:34 +0100
committerRichard Levitte <levitte@openssl.org>2016-01-30 16:23:44 +0100
commit33254e1c6fa6a1acf28fd0d9b6dc4ee30e569b95 (patch)
treef5b83d4466c8a1e593b73a5b1a342d14e7e58151 /apps/x509.c
parent421e30ec67451ac653e790295a36461a4069d0e4 (diff)
downloadopenssl-33254e1c6fa6a1acf28fd0d9b6dc4ee30e569b95.tar.gz
Fix opt_imax() call
Not all architectures have a time_t defined the same way. To make sure we get the same result, we need to cast &checkoffset to (intmax_t *) and make sure that intmax_t is defined somehow. To make really sure we don't pass a variable with the wrong size down to opt_imax(), we use a temporary intmax_t. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'apps/x509.c')
-rw-r--r--apps/x509.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/apps/x509.c b/apps/x509.c
index a8d0686a6b..5d6bb9679a 100644
--- a/apps/x509.c
+++ b/apps/x509.c
@@ -468,12 +468,16 @@ int x509_main(int argc, char **argv)
break;
case OPT_CHECKEND:
checkend = 1;
- if (!opt_imax(opt_arg(), &checkoffset))
- goto opthelp;
- if (checkoffset != (time_t)checkoffset) {
- BIO_printf(bio_err, "%s: checkend time out of range %s\n",
- prog, opt_arg());
- goto opthelp;
+ {
+ intmax_t temp = 0;
+ if (!opt_imax(opt_arg(), &temp))
+ goto opthelp;
+ checkoffset = (time_t)temp;
+ if ((intmax_t)checkoffset != temp) {
+ BIO_printf(bio_err, "%s: checkend time out of range %s\n",
+ prog, opt_arg());
+ goto opthelp;
+ }
}
break;
case OPT_CHECKHOST: