svn commit: r250171 - stable/8/libexec/rtld-elf
Konstantin Belousov
kib at FreeBSD.org
Thu May 2 04:23:58 UTC 2013
Author: kib
Date: Thu May 2 04:23:57 2013
New Revision: 250171
URL: http://svnweb.freebsd.org/changeset/base/250171
Log:
MFC r250075:
Properly terminate the result string for intermediate results.
Modified:
stable/8/libexec/rtld-elf/rtld.c
Directory Properties:
stable/8/libexec/rtld-elf/ (props changed)
Modified: stable/8/libexec/rtld-elf/rtld.c
==============================================================================
--- stable/8/libexec/rtld-elf/rtld.c Thu May 2 04:22:04 2013 (r250170)
+++ stable/8/libexec/rtld-elf/rtld.c Thu May 2 04:23:57 2013 (r250171)
@@ -697,7 +697,7 @@ origin_subst_one(char *real, const char
/*
* 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. */
@@ -706,6 +706,7 @@ origin_subst_one(char *real, const char
/* Keyword replacement. */
memcpy(resp, subst, subst_len);
resp += subst_len;
+ *resp = '\0';
p = p1 + kw_len;
} else
break;
More information about the svn-src-stable-8
mailing list