Problem: NULL pointer dereference in gui_photon (Ao Xijie)
Solution: after realloc() validate the buffer is not NULL.
closes: #20661
Signed-off-by: Christian Brabandt <cb@256bit.org>
// Use a static buffer to avoid large amounts of de/allocations
if (utf8_len < len)
{
- utf8_buffer = realloc(utf8_buffer, len * MB_LEN_MAX);
+ char *new_buffer = realloc(utf8_buffer, len * MB_LEN_MAX);
+
+ if (new_buffer == NULL)
+ return;
+ utf8_buffer = new_buffer;
utf8_len = len;
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 746,
/**/
745,
/**/