diff options
author | 2017-05-20 02:35:47 +0000 | |
---|---|---|
committer | 2017-05-20 02:35:47 +0000 | |
commit | 4eb62b194bb6c3592aacb7018600ad3ae73ebada (patch) | |
tree | 03ada7d588afb571a81db1d9189e7933889eb0c9 /usr.bin/ssh/readconf.c | |
parent | Now that we no longer support SSHv1, replace the contents of this file (diff) | |
download | wireguard-openbsd-4eb62b194bb6c3592aacb7018600ad3ae73ebada.tar.xz wireguard-openbsd-4eb62b194bb6c3592aacb7018600ad3ae73ebada.zip |
there's no reason to artificially limit the key path here, just check
that it fits PATH_MAX; spotted by Matthew Patton
Diffstat (limited to 'usr.bin/ssh/readconf.c')
-rw-r--r-- | usr.bin/ssh/readconf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c index 17e76a97fc9..7b4160e2c12 100644 --- a/usr.bin/ssh/readconf.c +++ b/usr.bin/ssh/readconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: readconf.c,v 1.275 2017/04/30 23:18:22 djm Exp $ */ +/* $OpenBSD: readconf.c,v 1.276 2017/05/20 02:35:47 djm Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -423,8 +423,8 @@ add_identity_file(Options *options, const char *dir, const char *filename, if (dir == NULL) /* no dir, filename is absolute */ path = xstrdup(filename); - else - (void)xasprintf(&path, "%.100s%.100s", dir, filename); + else if (xasprintf(&path, "%s%s", dir, filename) >= PATH_MAX) + fatal("Identity file path %s too long", path); /* Avoid registering duplicates */ for (i = 0; i < options->num_identity_files; i++) { |