[Midnightbsd-cvs] src [9320] trunk/libexec/rtld-elf/rtld.c: Properly terminate the result string for intermediate results.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Thu Mar 2 19:18:37 EST 2017
Revision: 9320
http://svnweb.midnightbsd.org/src/?rev=9320
Author: laffer1
Date: 2017-03-02 19:18:36 -0500 (Thu, 02 Mar 2017)
Log Message:
-----------
Properly terminate the result string for intermediate results.
Modified Paths:
--------------
trunk/libexec/rtld-elf/rtld.c
Modified: trunk/libexec/rtld-elf/rtld.c
===================================================================
--- trunk/libexec/rtld-elf/rtld.c 2017-03-03 00:18:01 UTC (rev 9319)
+++ trunk/libexec/rtld-elf/rtld.c 2017-03-03 00:18:36 UTC (rev 9320)
@@ -784,7 +784,7 @@
/*
* 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 @@
/* Keyword replacement. */
memcpy(resp, subst, subst_len);
resp += subst_len;
+ *resp = '\0';
p = p1 + kw_len;
} else
break;
More information about the Midnightbsd-cvs
mailing list