hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Yu (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-10542) Potential null pointer dereference in Jets3tFileSystemStore#retrieveBlock()
Date Fri, 16 Jan 2015 16:03:35 GMT

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

Ted Yu commented on HADOOP-10542:
---------------------------------

If in is null, do we return an empty fileBlock or raise exception ?
I lean toward the latter. e.g. raise IOE with message saying object with key blockToKey(block)
wasn't found.

> Potential null pointer dereference in Jets3tFileSystemStore#retrieveBlock()
> ---------------------------------------------------------------------------
>
>                 Key: HADOOP-10542
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10542
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: fs/s3
>    Affects Versions: 2.6.0
>            Reporter: Ted Yu
>            Priority: Minor
>
> {code}
>       in = get(blockToKey(block), byteRangeStart);
>       out = new BufferedOutputStream(new FileOutputStream(fileBlock));
>       byte[] buf = new byte[bufferSize];
>       int numRead;
>       while ((numRead = in.read(buf)) >= 0) {
> {code}
> get() may return null.
> The while loop dereferences in without null check.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message