Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-970

transferTo function of SftpRemotePathChannel will loop if count parameter is greater than file size

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.5.0
    • 2.5.0
    • Patch

    Description

      The method transferTo of SftpRemotePathChannel does not checks eof condition.

      • The exit condition from the reading loop is that totalRead variable is not less than count parameter.
      • At eof the value the method does not increment the totalRead variable
      • If count parameter value is greater than source file size the value of totalRead will never reach the count value

      In order to exit from the loop we need to check the eof condition.

      The attached patch contains:

      • A junit test (added to SftpRemotePathChannelTest.java)
      • A simple fix to the exit condition

      The problem was found on:

      • 2.4.0 released version
      • current git head

      Attachments

        1. SftpRemotePathChannel.patch
          4 kB
          Michele Milesi

        Issue Links

          Activity

            People

              gnodet Guillaume Nodet
              michele.milesi@icteam.it Michele Milesi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: