Roberto Deandrea created SSHD-1348:
--------------------------------------

             Summary: Client SSH_FXP_READ() with lenght = 0 causes 
SSH_FX_INVALID_PARAMETER into Apache SSHD SFTP Server
                 Key: SSHD-1348
                 URL: https://issues.apache.org/jira/browse/SSHD-1348
             Project: MINA SSHD
          Issue Type: Question
    Affects Versions: 2.16.0
            Reporter: Roberto Deandrea
         Attachments: sftp-read-empty.py

During SFTP client get of empty file setting lenght=0 , Apache SSHD replies 
with SSH_FXP_STATUS with SSH_FX_INVALID_PARAMETER.

We have noticed 2 different checks on buffer lenght.

In method SftpSubsystem.doRead() the check on length is the following:

*{color:#242424}ValidateUtils.checkTrue((long)length > 0L, "Invalid read 
length: %d", (long)length);{color}*

In method {color:#242424}AbstractSftpSubsystemHelper{color}.doRead() the check 
on length is the following :

*{color:#242424}ValidateUtils.checkTrue(readLen >= 0, "Illegal requested read 
length: %d", (long)readLen);{color}*

 

Q1. Is there a reason why the check on length are different ?

Q2. Is possble to read a file  setting buffer lenght = 0 ?

 

Thank you for your cooperation.

Roberto Deandrea

 

P.S. Attached to this Jira you can find a python script to simply reproduce 
this issue.

 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to