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>
This commit is contained in:
parent
421e30ec67
commit
33254e1c6f
@ -145,6 +145,8 @@ int opt_umax(const char *value, uintmax_t *result);
|
|||||||
# else
|
# else
|
||||||
# define opt_imax opt_long
|
# define opt_imax opt_long
|
||||||
# define opt_umax opt_ulong
|
# define opt_umax opt_ulong
|
||||||
|
# define intmax_t long
|
||||||
|
# define uintmax_t unsigned long
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
int app_RAND_load_file(const char *file, int dont_warn);
|
int app_RAND_load_file(const char *file, int dont_warn);
|
||||||
|
@ -468,13 +468,17 @@ int x509_main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case OPT_CHECKEND:
|
case OPT_CHECKEND:
|
||||||
checkend = 1;
|
checkend = 1;
|
||||||
if (!opt_imax(opt_arg(), &checkoffset))
|
{
|
||||||
|
intmax_t temp = 0;
|
||||||
|
if (!opt_imax(opt_arg(), &temp))
|
||||||
goto opthelp;
|
goto opthelp;
|
||||||
if (checkoffset != (time_t)checkoffset) {
|
checkoffset = (time_t)temp;
|
||||||
|
if ((intmax_t)checkoffset != temp) {
|
||||||
BIO_printf(bio_err, "%s: checkend time out of range %s\n",
|
BIO_printf(bio_err, "%s: checkend time out of range %s\n",
|
||||||
prog, opt_arg());
|
prog, opt_arg());
|
||||||
goto opthelp;
|
goto opthelp;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case OPT_CHECKHOST:
|
case OPT_CHECKHOST:
|
||||||
checkhost = opt_arg();
|
checkhost = opt_arg();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user