[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Segmentation fault when -x is added and variable contains nulls
From: |
Andreas Schwab |
Subject: |
Re: Segmentation fault when -x is added and variable contains nulls |
Date: |
Thu, 06 Feb 2014 16:06:56 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Greg Wooledge <address@hidden> writes:
> On Thu, Feb 06, 2014 at 11:51:25AM +0800, Dan Jacobson wrote:
>> # su - nobody
>> No directory, logging in with HOME=/
>> $ cat /tmp/r
>> LC_CTYPE=zh_TW.UTF-8 N=$(echo ??????|iconv -t big5 -f utf-8) sh -xc ': $N'
>> $ sh /tmp/r
>> /tmp/r: line 1: 4551 Segmentation fault LC_CTYPE=zh_TW.UTF-8 N=$(echo
>> ??????|iconv -t big5 -f utf-8) sh -xc ': $N'
>>
>> Something about that embedded null.
>> bash, version 4.3.0(1)-rc1 (i486-pc-linux-gnu)
>
> Just for the record, a variable can't contain a NUL byte. I don't
> know what your input string is (my system can't handle this locale; I
> just see ?????? in my mail client), nor do I know what the output of
> the iconv command is for that input. Let's speculate that (as implied
> by your Subject) there is a NUL byte somewhere in the middle of it.
BIG5 is a multi-byte encoding, it doesn't have embedded NUL bytes.
Andreas.
--
Andreas Schwab, SUSE Labs, address@hidden
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."