This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [ld, testsuite] Don't print to stdin for "readelf -w" to avoid buffer overflow
- From: Andreas Schwab <schwab at linux-m68k dot org>
- To: Jiong Wang <jiong dot wang at foss dot arm dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Sat, 04 Feb 2017 09:58:25 +0100
- Subject: Re: [ld, testsuite] Don't print to stdin for "readelf -w" to avoid buffer overflow
- Authentication-results: sourceware.org; auth=none
- References: <e417b89e-2cf7-c7bc-2b96-20b377c5697e@foss.arm.com>
On Feb 03 2017, Jiong Wang <jiong.wang@foss.arm.com> wrote:
> diff --git a/ld/testsuite/ld-elf/compress.exp b/ld/testsuite/ld-elf/compress.exp
> index 5620f3c..3fb4bd7 100644
> --- a/ld/testsuite/ld-elf/compress.exp
> +++ b/ld/testsuite/ld-elf/compress.exp
> @@ -171,7 +171,7 @@ if { [regexp_diff tmpdir/$test.out $srcdir/$subdir/$test.rt] } then {
> set test_name "Link with zlib compressed debug output"
> set test normal
> send_log "$READELF -w tmpdir/$test > tmpdir/$test.out\n"
> -set got [remote_exec host "$READELF -w tmpdir/$test" "" "/dev/null" "tmpdir/$test.out"]
> +set got [remote_exec host [concat sh -c [list "$READELF -w tmpdir/$test > tmpdir/$test.out"]] "" "/dev/null"]
Why do you need sh -c?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."