]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/limits.c: Check for overflow without invoking UB
authorAlejandro Colomar <alx@kernel.org>
Sat, 2 Sep 2023 13:43:24 +0000 (15:43 +0200)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Mon, 4 Dec 2023 10:45:09 +0000 (11:45 +0100)
commit5e0c61cce38d71bd4a531d5f78ab6398beccccd4
treec836f49685f5aff88937c486b23037d520c6fcbc
parent9b798b584adb919368af65fb4dce4d072714cbf8
lib/limits.c: Check for overflow without invoking UB

The multiplication was already invoking UB.  The test was flawed.
Use __builtin_mul_overflow() instead.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/limits.c