aboutsummaryrefslogtreecommitdiff
path: root/ld/ldmain.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2016-12-02 15:43:53 +0000
committerNick Clifton <nickc@redhat.com>2016-12-02 15:45:30 +0000
commitf5ac6ab387ef0974f6348ac7febc691fbb6c0eb4 (patch)
tree0c62cd4de1dc2d14fa4057b37cdc6877430d9307 /ld/ldmain.c
parenta9752fdf83985f62a0c343311a9cb42ad13f9876 (diff)
downloadgdb-f5ac6ab387ef0974f6348ac7febc691fbb6c0eb4.zip
gdb-f5ac6ab387ef0974f6348ac7febc691fbb6c0eb4.tar.gz
gdb-f5ac6ab387ef0974f6348ac7febc691fbb6c0eb4.tar.bz2
Fix seg-fault in the linker when attempting to print out a malicious linker script.
PR ld/20910 * ldmain.c (main): Prevent evaluation of %<char> sequences when printing out a linker script.
Diffstat (limited to 'ld/ldmain.c')
-rw-r--r--ld/ldmain.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ld/ldmain.c b/ld/ldmain.c
index 2f15ba7..41684ba 100644
--- a/ld/ldmain.c
+++ b/ld/ldmain.c
@@ -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);