]> git.ipfire.org Git - thirdparty/coreutils.git/commit
shuf: avoid integer overflow on huge inputs
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 4 Aug 2024 05:59:12 +0000 (22:59 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 4 Aug 2024 06:22:53 +0000 (23:22 -0700)
commit1ea7255f8b0661cdfabbd13f8f443f81665a07e0
tree4ff51cc0014ab3130062755843d5f718e6f76ad7
parentbfbb3ec7f798b179d7fa7b42673e068b18048899
shuf: avoid integer overflow on huge inputs

* gl/lib/randperm.c: Include <stdckdint.h>.
(randperm_bound): Return SIZE_MAX if the multiplication overflows.
Do not overflow when converting bit count to byte count.
gl/lib/randperm.c