summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/qsort.c
diff options
context:
space:
mode:
authorcheloha <>2021-12-02 20:58:01 +0000
committercheloha <>2021-12-02 20:58:01 +0000
commit6cb312a90e0db659665950da1acb2da29d74cadf (patch)
tree191e970e7b56e3251dc8e76dc81ab926e791f089 /src/lib/libc/stdlib/qsort.c
parent5f76eb00e8dae262a9b0c52bae0d3b6fe1ed6ce0 (diff)
downloadopenbsd-6cb312a90e0db659665950da1acb2da29d74cadf.tar.gz
openbsd-6cb312a90e0db659665950da1acb2da29d74cadf.tar.bz2
openbsd-6cb312a90e0db659665950da1acb2da29d74cadf.zip
bsearch(3): support arrays with more than INT_MAX elements
The "lim" variable needs to be a size_t to match nmemb, otherwise we get undefined behavior when nmemb exceeds INT_MAX. Prompted by a blog post by Joshua Bloch: https://ai.googleblog.com/2006/06/extra-extra-read-all-about-it-nearly.html Fixed by Chris Torek a long time ago: https://svnweb.freebsd.org/csrg/lib/libc/stdlib/bsearch.c?revision=51742&view=markup ok millert@
Diffstat (limited to 'src/lib/libc/stdlib/qsort.c')
0 files changed, 0 insertions, 0 deletions