Prevent potential integer overflow
PR: 192971 Submitted by: David Carlier <david.carlier@hardenedbsd.org>