Update pre10

This commit is contained in:
2018-08-23 00:44:44 +09:00
parent ef69dcb649
commit 6ed909873d
55 changed files with 818 additions and 394 deletions
+11 -5
View File
@@ -137,11 +137,12 @@ void *CRYPTO_secure_malloc(size_t num, const char *file, int line)
void *CRYPTO_secure_zalloc(size_t num, const char *file, int line)
{
void *ret = CRYPTO_secure_malloc(num, file, line);
if (ret != NULL)
memset(ret, 0, num);
return ret;
#ifdef IMPLEMENTED
if (secure_mem_initialized)
/* CRYPTO_secure_malloc() zeroes allocations when it is implemented */
return CRYPTO_secure_malloc(num, file, line);
#endif
return CRYPTO_zalloc(num, file, line);
}
void CRYPTO_secure_free(void *ptr, const char *file, int line)
@@ -588,6 +589,9 @@ static void *sh_malloc(size_t size)
OPENSSL_assert(WITHIN_ARENA(chunk));
/* zero the free list header as a precaution against information leakage */
memset(chunk, 0, sizeof(SH_LIST));
return chunk;
}
@@ -620,6 +624,8 @@ static void sh_free(void *ptr)
list--;
/* Zero the higher addressed block's free list pointers */
memset(ptr > buddy ? ptr : buddy, 0, sizeof(SH_LIST));
if (ptr > buddy)
ptr = buddy;