You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2018/09/18 08:07:00 UTC

[jira] [Commented] (OAK-7761) SegmentTarWriter#readSegment does not check the return value of FileChannel#read

    [ https://issues.apache.org/jira/browse/OAK-7761?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16618646#comment-16618646 ] 

Michael Dürig commented on OAK-7761:
------------------------------------

Proposed fix: [https://github.com/mduerig/jackrabbit-oak/commit/d9fb559a965ff6f038134897ebc642b9f4ff67e5]. Note, this fix depends on the {{IOUtils.readFully}} method introduced with OAK-7760.

[~frm], [~ahanikel] could you have a look?

> SegmentTarWriter#readSegment does not check the return value of FileChannel#read
> --------------------------------------------------------------------------------
>
>                 Key: OAK-7761
>                 URL: https://issues.apache.org/jira/browse/OAK-7761
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segment-tar
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>            Priority: Major
>             Fix For: 1.10
>
>
> We need to check the return value of {{FileChannel#read}} as that method might read fewer bytes than requested. The corresponding Javadoc is (hidden) at {{ReadableByteChannel#read}}: "A read operation might not fill the buffer, and in fact it might not read any bytes at all"



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)