freebsd-skq/lib/libiconv_modules
tijl 3fe26be600 MFC r283406,283418:
Fix decoding of UTF-7 when a base64 encoded chunk appears at the end of
the input buffer.

_citrus_UTF7_mbtoutf16 stored the decoder state at the beginning so it
could restore this state on an incomplete character such that the next
call would restart the decoding.  The problem was that "-" (end of base64
mode) at the end of a string was also treated as an incomplete character
but was also removed from the state buffer.  So the initial state would be
restored (with base64 mode) and the next call would no longer see the "-"
so it continued in base64 mode.

This state saving/restoring isn't needed here.  It's already handled
elsewhere (citrus_iconv_std.c:_citrus_iconv_std_iconv_convert) so just
remove it.

Also initialise *nresult.

When only 2 bytes can be read from a 4 byte UTF-16 character in a base64
encoded chunk of a UTF-7 string, treat that as an incomplete character and
return an error instead of a shift sequence and no error.

Also check that the low 2 bytes have a valid value.

PR:		200398
2015-06-02 09:42:00 +00:00
..
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2014-01-09 23:08:56 +00:00
2014-01-09 23:08:56 +00:00
2014-04-15 09:49:44 +00:00
2014-01-09 23:08:56 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2015-06-02 09:42:00 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2015-04-30 16:08:47 +00:00
2013-09-06 10:40:38 +00:00