mirror of
git://anongit.mindrot.org/openssh.git
synced 2025-01-11 12:09:32 +00:00
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
This commit is contained in:
parent
773224802d
commit
947a3e829a
@ -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>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* 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,
|
|||||||
|
|
||||||
if (dir == NULL) /* no dir, filename is absolute */
|
if (dir == NULL) /* no dir, filename is absolute */
|
||||||
path = xstrdup(filename);
|
path = xstrdup(filename);
|
||||||
else
|
else if (xasprintf(&path, "%s%s", dir, filename) >= PATH_MAX)
|
||||||
(void)xasprintf(&path, "%.100s%.100s", dir, filename);
|
fatal("Identity file path %s too long", path);
|
||||||
|
|
||||||
/* Avoid registering duplicates */
|
/* Avoid registering duplicates */
|
||||||
for (i = 0; i < options->num_identity_files; i++) {
|
for (i = 0; i < options->num_identity_files; i++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user