diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/mem_sec.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/mem_sec.c b/crypto/mem_sec.c index 0c79b43658..4a3f2a84a2 100644 --- a/crypto/mem_sec.c +++ b/crypto/mem_sec.c @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 2015-2017 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -352,6 +352,9 @@ static int sh_init(size_t size, int minsize) if (minsize <= 0 || (minsize & (minsize - 1)) != 0) goto err; + while (minsize < (int)sizeof(SH_LIST)) + minsize *= 2; + sh.arena_size = size; sh.minsize = minsize; sh.bittable_size = (sh.arena_size / sh.minsize) * 2; |