[client] egl: fix buffer overflow

This commit is contained in:
Geoffrey McRae 2023-03-30 14:16:19 +11:00
parent e067db7bb4
commit 0ee5751b3a

View File

@ -226,7 +226,7 @@ bool egl_shaderCompile(EGL_Shader * this, const char * vertex_code,
}
const int diff = (strlen(replace) - strlen(search)) * instances;
char * newCode = malloc(fragment_size + diff);
char * newCode = malloc(fragment_size + diff + 1);
if (!newCode)
{
DEBUG_ERROR("Out of memory");