Fix seg-fault in the linker when attempting to print out a malicious linker script.
authorNick Clifton <nickc@redhat.com>
Fri, 2 Dec 2016 15:43:53 +0000 (15:43 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 2 Dec 2016 15:45:30 +0000 (15:45 +0000)
PR ld/20910
* ldmain.c (main): Prevent evaluation of %<char> sequences when
printing out a linker script.

ld/ChangeLog
ld/ldmain.c

index 1d1c91ae72f5121c1197f1ac361015ddba3cb3cb..a4b6949333e8264c78fd28ecd1c40d1fd7410c4b 100644 (file)
@@ -1,5 +1,9 @@
 2016-12-02  Nick Clifton  <nickc@redhat.com>
 
+       PR ld/20910
+       * ldmain.c (main): Prevent evaluation of %<char> sequences when
+       printing out a linker script.
+
        PR ld/20911
        * ldctor.c (ldctor_build_sets): Produce alternative error message
        if the reloc was being applied to a special section.
index 2f15ba72a9c6aeddf40761c3ff6d5a4b13428bf5..41684ba195fded6e510d5fcbb7db6156e755af58 100644 (file)
@@ -368,7 +368,7 @@ main (int argc, char **argv)
          while ((n = fread (buf, 1, ld_bufsz - 1, saved_script_handle)) > 0)
            {
              buf[n] = 0;
-             info_msg (buf);
+             info_msg ("%s", buf);
            }
          rewind (saved_script_handle);
          free (buf);