aboutsummaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2013-04-29 21:12:25 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2013-04-29 21:12:25 +0000
commit3c9cb0c6c9b5c21e82994808cbb59cdf9e27a87c (patch)
treea1b0e2ef4e4927910da9c1f7c3981d66c7631ae3 /libexec
parent5c6fe3a917ad4fe566077d9fab4c8ec398a18807 (diff)
Notes
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rtld-elf/rtld.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index 7a3938fd4ce02..2da990ce574f7 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -784,7 +784,7 @@ origin_subst_one(char *real, const char *kw, const char *subst,
/*
* Now, execute the substitution loop.
*/
- for (p = real, resp = res;;) {
+ for (p = real, resp = res, *resp = '\0';;) {
p1 = strstr(p, kw);
if (p1 != NULL) {
/* Copy the prefix before keyword. */
@@ -793,6 +793,7 @@ origin_subst_one(char *real, const char *kw, const char *subst,
/* Keyword replacement. */
memcpy(resp, subst, subst_len);
resp += subst_len;
+ *resp = '\0';
p = p1 + kw_len;
} else
break;