[ 
https://issues.apache.org/jira/browse/HBASE-19484?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gavin updated HBASE-19484:
--------------------------
    Comment: was deleted

(was: A comment with security level 'jira-users' was removed.)

> 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, 2.0.0
>
>         Attachments: HBASE-19484.addendum.patch, HBASE-19484.v0.patch
>
>
> 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
(v7.6.3#76005)

Reply via email to