summaryrefslogtreecommitdiffstats
path: root/usr.bin/gcore
diff options
context:
space:
mode:
authortijl <tijl@FreeBSD.org>2015-06-02 09:42:00 +0000
committertijl <tijl@FreeBSD.org>2015-06-02 09:42:00 +0000
commit3fe26be600cb42528e02e037417f988ddb859a4c (patch)
tree39abd60b445dbaaba906a89e4890cff4bf3dab45 /usr.bin/gcore
parent651b599a096c2690c4602c70939df679e88c882a (diff)
downloadFreeBSD-src-3fe26be600cb42528e02e037417f988ddb859a4c.zip
FreeBSD-src-3fe26be600cb42528e02e037417f988ddb859a4c.tar.gz
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
Diffstat (limited to 'usr.bin/gcore')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud