hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chia-Ping Tsai (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-19484) The value array written by ExtendedCell#write is out of bounds
Date Mon, 11 Dec 2017 01:09:00 GMT
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.
  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);

This message was sent by Atlassian JIRA

View raw message