[ http://issues.apache.org/jira/browse/DERBY-1396?page=all ]

Kristian Waagan closed DERBY-1396.
----------------------------------


>  ReEncodedInputStream may fail to read all of source Reader.
> ------------------------------------------------------------
>
>                 Key: DERBY-1396
>                 URL: http://issues.apache.org/jira/browse/DERBY-1396
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Server
>    Affects Versions: 10.2.0.0
>            Reporter: Tomohito Nakayama
>         Assigned To: Tomohito Nakayama
>             Fix For: 10.2.0.0
>
>         Attachments: DERBY-1396.patch
>
>
> The class org.apache.derby.impl.drda.ReEncodedInputStream seems to have a 
> bug...
> In this class, there exists next code.
>         int count;
>       if(( count = reader.read(decodedBuffer_, 0, BUFFERED_CHAR_LEN )) < 1 ){
>           return null;
>       }
> In this code, the condition of "<1" was intended to judge whether reader was 
> read entirely.
> However,spec of java api says that reader returns -1 if the end of the reader 
> has been reached and not 0.
> Then "<1" is not appropriate.
> Current code judges 0 as the end of reader.
> Then, if 0 was returned in the meaning that "No character was read now but 
> may continue" as possible in java api, 
> this code will not work correctly...

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to