[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:
Armin Novak
2026-02-17 12:05:42 +01:00
parent fac35c3abb
commit 118afc0b95
28 changed files with 154 additions and 105 deletions

View File

@@ -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)
{