Skip to content

Commit 1920772

Browse files
romanmichalvasko
authored andcommitted
session server ssh BUGFIX check for NULL path fmt
1 parent 1ea193e commit 1920772

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/session_server_ssh.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,11 @@ nc_server_ssh_get_system_keys_path(const char *username, char **out_path)
284284
struct passwd *pw, pw_buf;
285285
size_t buf_len = 0;
286286

287+
if (!path_fmt) {
288+
ERR(NULL, "System public keys path format not set.");
289+
return 1;
290+
}
291+
287292
/* check if the path format contains any tokens */
288293
if (strstr(path_fmt, "%h") || strstr(path_fmt, "%U") || strstr(path_fmt, "%u") || strstr(path_fmt, "%%")) {
289294
/* get pw */

0 commit comments

Comments
 (0)