diff options
author | cheloha <> | 2021-12-02 20:58:01 +0000 |
---|---|---|
committer | cheloha <> | 2021-12-02 20:58:01 +0000 |
commit | 6cb312a90e0db659665950da1acb2da29d74cadf (patch) | |
tree | 191e970e7b56e3251dc8e76dc81ab926e791f089 /src/lib/libc/stdlib/strtoll.c | |
parent | 5f76eb00e8dae262a9b0c52bae0d3b6fe1ed6ce0 (diff) | |
download | openbsd-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/strtoll.c')
0 files changed, 0 insertions, 0 deletions