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;
_______________________________________________
svn-src-stable-9@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-stable-9
To unsubscribe, send any mail to "svn-src-stable-9-unsubscr...@freebsd.org"

Reply via email to