void-packages/srcpkgs/slim/patches/fix-array-overflow.patch

12 lines
403 B
Diff

--- app.cpp (revision 223)
+++ app.cpp (working copy)
@@ -593,7 +593,7 @@
n++;
- child_env = static_cast<char**>(malloc(sizeof(char*)*n));
+ child_env = static_cast<char**>(malloc(sizeof(char*)*(n+1)));
memcpy(child_env, old_env, sizeof(char*)*n);
child_env[n - 1] = StrConcat("XDG_SESSION_COOKIE=", ck.get_xdg_session_cookie());
child_env[n] = NULL;