Message-Id: <
1094443392.12379.35.camel@linux.heathens.co.nz>
a read(F) into a UTF8-encoded buffer with an offset off the
end of the buffer, miss-calculated buffer lengths
p4raw-id: //depot/perl@23321
}
if (DO_UTF8(bufsv)) {
/* convert offset-as-chars to offset-as-bytes */
- offset = utf8_hop((U8 *)buffer,offset) - (U8 *) buffer;
+ if (offset >= (int)blen)
+ offset += SvCUR(bufsv) - blen;
+ else
+ offset = utf8_hop((U8 *)buffer,offset) - (U8 *) buffer;
}
more_bytes:
bufsize = SvCUR(bufsv);