You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Chia-Ping Tsai (JIRA)" <ji...@apache.org> on 2017/12/11 01:09:00 UTC
[jira] [Created] (HBASE-19484) The value array written by
ExtendedCell#write is out of bounds
Chia-Ping Tsai created HBASE-19484:
--------------------------------------
Summary: The value array written by ExtendedCell#write is out of bounds
Key: HBASE-19484
URL: https://issues.apache.org/jira/browse/HBASE-19484
Project: HBase
Issue Type: Bug
Reporter: Chia-Ping Tsai
Assignee: Chia-Ping Tsai
Priority: Blocker
Fix For: 2.0.0-beta-1
I move the impl of IndividualBytesFieldCell#write to ExtendedCell so as to make it be a default method (see HBASE-19430), but I didn't notice that the value array doesn't be handled correctly.
{code:title=ExtendedCell}
default int write(OutputStream out, boolean withTags) throws IOException {
// Key length and then value length
ByteBufferUtils.putInt(out, KeyValueUtil.keyLength(this));
ByteBufferUtils.putInt(out, getValueLength());
// Key
PrivateCellUtil.writeFlatKey(this, out);
// Value
out.write(getValueArray()); // <-- here
// Tags length and tags byte array
if (withTags && getTagsLength() > 0) {
// Tags length
out.write((byte)(0xff & (getTagsLength() >> 8)));
out.write((byte)(0xff & getTagsLength()));
// Tags byte array
out.write(getTagsArray(), getTagsOffset(), getTagsLength());
}
return getSerializedSize(withTags);
}
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)