svn commit: r250170 - stable/9/libexec/rtld-elf

Konstantin Belousov kib at FreeBSD.org
Thu May 2 04:22:05 UTC 2013


Author: kib
Date: Thu May  2 04:22:04 2013
New Revision: 250170
URL: http://svnweb.freebsd.org/changeset/base/250170

Log:
  MFC r250075:
  Properly terminate the result string for intermediate results.

Modified:
  stable/9/libexec/rtld-elf/rtld.c
Directory Properties:
  stable/9/libexec/rtld-elf/   (props changed)

Modified: stable/9/libexec/rtld-elf/rtld.c
==============================================================================
--- stable/9/libexec/rtld-elf/rtld.c	Thu May  2 01:39:32 2013	(r250169)
+++ stable/9/libexec/rtld-elf/rtld.c	Thu May  2 04:22:04 2013	(r250170)
@@ -784,7 +784,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. */
@@ -793,6 +793,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-9 mailing list