]> git.ipfire.org Git - thirdparty/coreutils.git/commit
sort: fix bug on 64-bit hosts with at least 32768 processors
authorPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Dec 2010 05:50:00 +0000 (21:50 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Thu, 2 Dec 2010 05:51:15 +0000 (21:51 -0800)
commit0ec869e8be853e19f8d98692a1867c5cddf9975b
tree0343dd0e90e153acabf2defde934a80a7aef59ea
parenta5207bb1391cb8e169bc6036eb036bb1a89cde89
sort: fix bug on 64-bit hosts with at least 32768 processors

* src/sort.c (MAX_MERGE): Avoid integer overflow when on a machine
with (say) 32-bit int and 64-bit size_t and when level == 15.
Without this fix, on such a machine with 32768 or more processors,
the level computation could overflow on large input, and this
would result in division by zero.
src/sort.c