Browse Source

Fix fix-array-overflow #18696

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>

git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/slim/trunk@225 7c53e7cc-98ea-0310-8f1f-a0b24da60408
iwamatsu 11 years ago
parent
commit
ffe810281d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app.cpp

+ 1 - 1
app.cpp

@@ -587,7 +587,7 @@ void App::Login() {
 		n++;
 
 		child_env = static_cast<char**>(malloc(sizeof(char*)*n));
-		memcpy(child_env, old_env, sizeof(char*)*n);
+		memcpy(child_env, old_env, sizeof(char*)*n+1);
 		child_env[n - 1] = StrConcat("XDG_SESSION_COOKIE=", ck.get_xdg_session_cookie());
 		child_env[n] = NULL;
 # endif /* USE_CONSOLEKIT */