Git Product home page Git Product logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
I don't understand why this is incorrect.

Original comment by [email protected] on 8 Apr 2014 at 11:44

from ganymed-ssh-2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024

Original comment by [email protected] on 9 Apr 2014 at 1:12

  • Changed state: WontFix

from ganymed-ssh-2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Sorry if I didn't clarify enough.

The bug is subtle and difficult to recognize with the eye, given that the exact 
same sequence of lines is correct in line 112 in the other read(...) method 
(the one with signature read(byte[], int, int)).

But, in the read() method without arguments, the value returned by the call to 
super.read() (in line 81, [1]) is _not_ the _number_ of bytes read, but the 
_value_ of the last read byte, as per definition of read (see [2]). It is thus 
an error to subtract that value from the number of remaining bytes, since the 
number of remaing bytes has only decreased by 1 (at max).

At the company I work for we use a workaround for this bug (only use the 
read(byte[]) variant).

Hope I made it clearer this time.

[1] 
https://code.google.com/p/ganymed-ssh-2/source/browse/trunk/src/main/java/ch/eth
z/ssh2/SCPInputStream.java#81
[2] http://docs.oracle.com/javase/7/docs/api/java/io/InputStream.html#read()

Original comment by [email protected] on 10 Apr 2014 at 8:56

from ganymed-ssh-2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 30, 2024
Thanks for the clarification. Fix in r103.

Original comment by [email protected] on 10 Apr 2014 at 1:58

  • Changed state: Fixed

from ganymed-ssh-2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.