NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/47813: iconv(1): Inappropriate ioctl for device



>Number:         47813
>Category:       bin
>Synopsis:       iconv(1): Inappropriate ioctl for device
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 14 01:50:01 +0000 2013
>Originator:     Aleksey Cheusov
>Release:        NetBSD 6.1_RC2
>Organization:
>Environment:
System: NetBSD asrock.chizhovka.net 6.1_RC2 NetBSD 6.1_RC2 (GENERIC) #4: Sun 
Mar 24 00:02:51 FET 2013 
cheusov%asrock.chizhovka.net@localhost:/srv/obj/sys/arch/amd64/compile/GENERIC 
amd64
Architecture: x86_64
Machine: amd64
>Description:
iconv(1) unexpectedly fails iff more than 512 bytes are given on input
and stdout is redirected to /dev/null.

   0 ~>a=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
   0 ~>echo $a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a | iconv -f utf-8 -t ucs-4le > 
/dev/null
   iconv: iconv(): Inappropriate ioctl for device
   0 1 ~>echo $a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a | iconv -f utf-8 -t ucs-4le > log
   0 0 ~>echo $a$a$a$a$a$a$a$a$a$a$a$a$a$a$a$a | wc -c
     513
   0 0 ~>echo short string | iconv -f utf-8 -t ucs-4le > /dev/null
   0 0 ~>

Function __iconv called from iconv.c:do_conv returns -1 because
internal buffer is not big enough (513*4 > 2048) and sets errno to E2BIG
which is then overriden to ENOTTY by fwrite(3).

>How-To-Repeat:
See above. It is reproducible on narn.n.o

>Fix:

Unknown


Home | Main Index | Thread Index | Old Index