Fix an integer overflow in o_time.c
authorjwalch <jeremy.walch@gmail.com>
Fri, 19 Feb 2021 18:02:27 +0000 (13:02 -0500)
committerPauli <ppzgs1@gmail.com>
Wed, 24 Feb 2021 22:39:07 +0000 (08:39 +1000)
commit75de54363506e2b2480fc6baf0cd45b1f7fc8816
treeef4cd8c7d9f2e589ea8d9c80bf72f79c70e33b62
parent5eb73cfb372a3701a25f9d4f5e109ba21669af61
Fix an integer overflow in o_time.c

If input offset_sec is sufficiently large (> INT32_MAX * SECS_PER_DAY, which is possible for a long on 64-bit platforms), then the first assignment contains an overflow.

I think leaving offset_hms as an int is still safe.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14252)
crypto/o_time.c