diff options
author | djm@openbsd.org <djm@openbsd.org> | 2017-05-20 02:35:47 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2017-05-20 14:30:14 +1000 |
commit | 947a3e829a5b8832a4768fd764283709a4ca7955 (patch) | |
tree | 72b9de786ba50f8472a2bc92ecfa9bf9ae0052a4 /readconf.c | |
parent | 773224802d7cb250bb8b461546fcce10567b4b2e (diff) |
upstream commit
there's no reason to artificially limit the key path
here, just check that it fits PATH_MAX; spotted by Matthew Patton
Upstream-ID: 858addaf2009c9cf04d80164a41b2088edb30b58
Diffstat (limited to 'readconf.c')
-rw-r--r-- | readconf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/readconf.c b/readconf.c index aee5a8a79..4be5327a9 100644 --- a/readconf.c +++ b/readconf.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: readconf.c,v 1.275 2017/04/30 23:18:22 djm Exp $ */ | 1 | /* $OpenBSD: readconf.c,v 1.276 2017/05/20 02:35:47 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -438,8 +438,8 @@ add_identity_file(Options *options, const char *dir, const char *filename, | |||
438 | 438 | ||
439 | if (dir == NULL) /* no dir, filename is absolute */ | 439 | if (dir == NULL) /* no dir, filename is absolute */ |
440 | path = xstrdup(filename); | 440 | path = xstrdup(filename); |
441 | else | 441 | else if (xasprintf(&path, "%s%s", dir, filename) >= PATH_MAX) |
442 | (void)xasprintf(&path, "%.100s%.100s", dir, filename); | 442 | fatal("Identity file path %s too long", path); |
443 | 443 | ||
444 | /* Avoid registering duplicates */ | 444 | /* Avoid registering duplicates */ |
445 | for (i = 0; i < options->num_identity_files; i++) { | 445 | for (i = 0; i < options->num_identity_files; i++) { |