diff options
author | pgen <p.gen.progs@gmail.com> | 2022-03-06 11:27:52 +0100 |
---|---|---|
committer | pgen <p.gen.progs@gmail.com> | 2022-03-06 11:30:20 +0100 |
commit | 02f1084e8c0338dc93ad890631e62866b0a14b42 (patch) | |
tree | fd10bb299345923fd5e9a4a1516bb13c3abc5804 | |
parent | 79c36e035dd8a3ffe16599d0bd4d194d4aadb700 (diff) |
Fix a potential segfault when allocating ini paths
-rw-r--r-- | smenu.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -829,7 +829,7 @@ make_ini_path(char * name, char * base) len = strlen(home) + strlen(name) + 3; if (path_max < 0) - path_max = 4096; /* POSIX minimal value. */ + path_max = 4096; /* POSIX minimal value. path_max >= 4096. */ if (len <= path_max) { @@ -840,7 +840,7 @@ make_ini_path(char * name, char * base) else conf = name; - snprintf(path, 4096, "%s/.%s", home, conf); + snprintf(path, len, "%s/.%s", home, conf); } else path = NULL; |