]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/: Saturate addition to avoid overflow
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 18 Dec 2023 19:45:44 +0000 (20:45 +0100)
committerSerge Hallyn <serge@hallyn.com>
Tue, 13 Feb 2024 22:02:49 +0000 (16:02 -0600)
commit674409e2265eb12e02658d59b2efd0f0ef53419b
tree7efde147033622dcf75f298840538cd81fc73cb7
parent20100e4b22c318016cf5850a385baafa76acbd5c
lib/: Saturate addition to avoid overflow

Very large values in /etc/shadow could lead to overflows.  Make sure
that these calculations are saturated at LONG_MAX.  Since entries are
based on days and not seconds since epoch, saturating won't hurt anyone.

Co-developed-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Co-developed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/age.c
lib/isexpired.c