diff options
author | DJ Delorie <dj@delorie.com> | 2017-01-31 16:23:57 -0500 |
---|---|---|
committer | DJ Delorie <dj@delorie.com> | 2017-01-31 20:00:02 -0500 |
commit | 3a93781c77ef510ad60720479b74c8b597d51a55 (patch) | |
tree | 371e06cd662d3200feee3f081022f1af59cdb9a8 /malloc/malloc.c | |
parent | 8fc36e8a22e61051641f5c7f979f1f9fb07a5a8d (diff) | |
download | glibc-3a93781c77ef510ad60720479b74c8b597d51a55.zip glibc-3a93781c77ef510ad60720479b74c8b597d51a55.tar.gz glibc-3a93781c77ef510ad60720479b74c8b597d51a55.tar.bz2 |
Fix boundary error
Diffstat (limited to 'malloc/malloc.c')
-rw-r--r-- | malloc/malloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/malloc/malloc.c b/malloc/malloc.c index d19fa03..197fe0c 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1791,7 +1791,7 @@ static struct malloc_par mp_ = , .tcache_count = TCACHE_FILL_COUNT, .tcache_max = TCACHE_IDX, - .tcache_max_bytes = tidx2usize (TCACHE_IDX), + .tcache_max_bytes = tidx2usize (TCACHE_IDX-1), .tcache_unsorted_limit = 0 /* No limit */ #endif }; @@ -3632,9 +3632,9 @@ _int_malloc (mstate av, size_t bytes) #if USE_TCACHE INTERNAL_SIZE_T tcache_nb = 0; - if (csize2tidx (nb) <= mp_.tcache_max) - tcache_nb = nb; size_t tc_idx = csize2tidx (nb); + if (tc_idx < mp_.tcache_max) + tcache_nb = nb; int return_cached = 0; tcache_unsorted_count = 0; |