Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/waltz/openssl/fd_openssl_tile.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,12 @@ crypto_malloc( ulong num,
int line ) {
(void)file;
(void)line;
void * result = fd_alloc_malloc( fd_ossl_alloc, 8UL, num + 8UL );
ulong alloc_sz;
if( FD_UNLIKELY( __builtin_uaddl_overflow( num, 8UL, &alloc_sz ) ) ) {
fd_ossl_alloc_errors++;
return NULL;
}
void * result = fd_alloc_malloc( fd_ossl_alloc, 8UL, alloc_sz );
if( FD_UNLIKELY( !result ) ) {
fd_ossl_alloc_errors++;
return NULL;
Expand Down Expand Up @@ -66,7 +71,12 @@ crypto_realloc( void * addr,
return NULL;
}

void * new = fd_alloc_malloc( fd_ossl_alloc, 8UL, num + 8UL );
ulong alloc_sz;
if( FD_UNLIKELY( __builtin_uaddl_overflow( num, 8UL, &alloc_sz ) ) ) {
fd_ossl_alloc_errors++;
return NULL;
}
void * new = fd_alloc_malloc( fd_ossl_alloc, 8UL, alloc_sz );
if( FD_UNLIKELY( !new ) ) return NULL;

ulong old_num = *(ulong*)( (uchar*)addr - 8UL );
Expand Down