diff options
author | 2017-06-22 20:44:36 +0000 | |
---|---|---|
committer | 2017-06-22 20:44:36 +0000 | |
commit | 6f60d148b3e231ec6045b9e923a38464ce52e8e8 (patch) | |
tree | 098df3da0fb6ff32656471df488812fba461872d | |
parent | Close file descriptor on an exit path. (diff) | |
download | wireguard-openbsd-6f60d148b3e231ec6045b9e923a38464ce52e8e8.tar.xz wireguard-openbsd-6f60d148b3e231ec6045b9e923a38464ce52e8e8.zip |
Do not interpret an empty path as current working directory "." when
parsing LD_LIBRARY_PATH, and in DT_RPATH and DT_RUNPATH attributes and
in ld.so.hints.
ok deraadt@
-rw-r--r-- | libexec/ld.so/path.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/libexec/ld.so/path.c b/libexec/ld.so/path.c index 34a52dbb5a2..f0dd706e3a9 100644 --- a/libexec/ld.so/path.c +++ b/libexec/ld.so/path.c @@ -1,4 +1,4 @@ -/* $OpenBSD: path.c,v 1.6 2015/05/22 13:48:25 jsg Exp $ */ +/* $OpenBSD: path.c,v 1.7 2017/06/22 20:44:36 benno Exp $ */ /* * Copyright (c) 2013 Kurt Miller <kurt@intricatesoftware.com> @@ -52,14 +52,7 @@ _dl_split_path(const char *searchpath) while (*pp != '\0' && *pp != ':' && *pp != ';') pp++; - /* interpret "" as curdir "." */ - if (p_begin == pp) { - retval[pos] = _dl_malloc(2); - if (retval[pos] == NULL) - goto badret; - - _dl_bcopy(".", retval[pos++], 2); - } else { + if (p_begin != pp) { retval[pos] = _dl_malloc(pp - p_begin + 1); if (retval[pos] == NULL) goto badret; @@ -68,7 +61,7 @@ _dl_split_path(const char *searchpath) retval[pos++][pp - p_begin] = '\0'; } - if (*pp) /* Try curdir if ':' at end */ + if (*pp) pp++; else pp = NULL; |