The following error occurs on Windows when attempting to use string_replace function though may happen on some other exotic platform:
file:..\..\..\src\libs\zbxcommon\str.c,line:388 zbx_malloc: out of memory. Requested 4294967614 bytes.
Diff is signed, while count is unsigned.
Diff can be negative:
Diff is add to strlen, however count is unsigned so count*diff may become large number in my case 4294967614 which is larger then maximum unsigned long type.