mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[allocations] fix growth of preallocated buffers
* Replace * 2 with * sizeof(WCHAR) for string usages * Grow streams and other buffers reasonably, e.g. add 128 elements per try and check for possible overflows * Add constant postfix to force them to 64bit
This commit is contained in:
@@ -78,12 +78,9 @@ static char* makecert_read_str(BIO* bio, size_t* pOffset)
|
||||
|
||||
while (offset >= length)
|
||||
{
|
||||
size_t new_len = 0;
|
||||
size_t readBytes = 0;
|
||||
char* new_str = NULL;
|
||||
new_len = length * 2;
|
||||
if (new_len == 0)
|
||||
new_len = 2048;
|
||||
size_t new_len = length + 2048ull;
|
||||
|
||||
if (new_len > INT_MAX)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user