Copy the home directory if it comes from getpwuid.

This commit is contained in:
nicm
2026-07-19 19:09:30 +00:00
committed by tmux update bot
parent c766669b3b
commit 8024fab1f2

4
tmux.c
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: tmux.c,v 1.221 2026/06/29 18:17:28 nicm Exp $ */
/* $OpenBSD: tmux.c,v 1.222 2026/07/19 19:09:30 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -360,7 +360,7 @@ find_home(void)
if (home == NULL || *home == '\0') {
pw = getpwuid(getuid());
if (pw != NULL)
home = pw->pw_dir;
home = xstrdup(pw->pw_dir);
else
home = NULL;
}