This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ld, testsuite] Don't print to stdin for "readelf -w" to avoid buffer overflow


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]