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: Jiong Wang <jiong dot wang at foss dot arm dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Sat, 04 Feb 2017 15:20:28 +0000
- 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> <m2zii2e3im.fsf@linux-m68k.org>
Andreas Schwab writes:
> 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?
To be honest, I do not know much about Tcl/Expect, so was trying to
follow existed use cases. I had grep through ld testsuite, and found
similar cases are using " [concat sh -c..."
grep "remote_exec.*concat" $LD/testsuite/ -r
Thanks.
--
Regards,
Jiong