This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/1383] iconv doesn't detect invalid UTF-8 input as early as possible
- From: "drepper at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 14 Oct 2005 06:05:31 -0000
- Subject: [Bug libc/1383] iconv doesn't detect invalid UTF-8 input as early as possible
- References: <20050927184923.1383.egmont@uhulinux.hu>
- Reply-to: sourceware-bugzilla at sourceware dot org
------- Additional Comments From drepper at redhat dot com 2005-10-14 06:05 -------
Look at your code:
cd = iconv_open("UTF-8", argv[2]);
This line uses the command line parameter as the *source* encoding, not the
target encoding. This means the behavior is perfectly fine. For less than 4
bytes of input EINVAL is returned, with 4 bytes of input a really high number is
used as the UCS-4 value and it has no UTF-8 equivalent.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://sourceware.org/bugzilla/show_bug.cgi?id=1383
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.