Package: slim / 1.3.6-3~bpo70+1

slim-fix-env-alloc.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: Fix env alloc
Author: Nicolas Schier <nicolas@cs.tu-berlin.de>
Bug-Debian: http://bugs.debian.org/733916

diff --git a/app.cpp b/app.cpp
index eb7e05f..6ffb6f8 100644
--- a/app.cpp
+++ b/app.cpp
@@ -596,8 +596,8 @@ void App::Login() {
 
 		n++;
 
-		child_env = static_cast<char**>(malloc(sizeof(char*)*n));
-		memcpy(child_env, old_env, sizeof(char*)*n+1);
+		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;
 # endif /* USE_CONSOLEKIT */