mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-04-14 22:51:50 +03:00
stress/sizes: Fix an off-by-one issue.
Algorithmically, a size greater than 1024 ZB could access one-past-the-end of the sizes array. This couldn't really happen since SIZE_MAX is less than 1024 ZB on all platforms we support (and we pick the arguments to this function to be reasonable anyways), but it's not like there's any reason *not* to fix it, either.
This commit is contained in:
parent
dcfa6fd507
commit
7e09a57b39
1 changed files with 1 additions and 1 deletions
|
|
@ -17,7 +17,7 @@ do_print(const char *name, size_t sz_bytes) {
|
|||
|
||||
size_t ind = 0;
|
||||
double sz = sz_bytes;
|
||||
while (sz >= 1024 && ind < sizes_max) {
|
||||
while (sz >= 1024 && ind < sizes_max - 1) {
|
||||
sz /= 1024;
|
||||
ind++;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue