mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 06:38:37 -05:00
Fix segfault when HOME not set on Unix.
[originally from svn r4948]
This commit is contained in:
parent
e83034fe3f
commit
30e94b6a5c
@ -85,6 +85,8 @@ static void make_filename(char *filename, int index, const char *subname)
|
|||||||
char *home;
|
char *home;
|
||||||
int len;
|
int len;
|
||||||
home = getenv("HOME");
|
home = getenv("HOME");
|
||||||
|
if (!home)
|
||||||
|
home="/";
|
||||||
strncpy(filename, home, FILENAME_MAX);
|
strncpy(filename, home, FILENAME_MAX);
|
||||||
len = strlen(filename);
|
len = strlen(filename);
|
||||||
if (index == INDEX_SESSION) {
|
if (index == INDEX_SESSION) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user