You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2020/01/08 21:43:49 UTC

[GitHub] [netbeans] jlahoda opened a new pull request #1855: InputStream.read() may read less bytes than requested - using …

jlahoda opened a new pull request #1855: InputStream.read(<array>) may read less bytes than requested - using …
URL: https://github.com/apache/netbeans/pull/1855
 
 
   …readFully to read all requested bytes.
   
   Unfortunately, I don't know how to test this. Basically, InputStream.read(<array>) is specified in such a way that if may read less bytes than requested. But the CLIHandler is not checking how many bytes where actually read, and so if the method reads a shorter chunk of bytes than expected, the method will continue and will interpret the next byte as a command/reply - but that byte is "random", and the server and client desynchronize and the connection effectively stops to work. Luckily, the instance of the InputStream here is a DataInputStream and it always had the readFully method, so we can use it.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] lkishalmi commented on issue #1855: InputStream.read() may read less bytes than requested - using …

Posted by GitBox <gi...@apache.org>.
lkishalmi commented on issue #1855: InputStream.read(<array>) may read less bytes than requested - using …
URL: https://github.com/apache/netbeans/pull/1855#issuecomment-572343737
 
 
   Do we have an actual issue/bug which relates to this? I'm just corious that this kind of fixes do not happen on somebody browsing the code.
   Also maybe this has similar origins: https://issues.apache.org/jira/browse/NETBEANS-2510

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach commented on issue #1855: InputStream.read() may read less bytes than requested - using …

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on issue #1855: InputStream.read(<array>) may read less bytes than requested - using …
URL: https://github.com/apache/netbeans/pull/1855#issuecomment-572418064
 
 
   Silly error. Sorry.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] JaroslavTulach merged pull request #1855: InputStream.read() may read less bytes than requested - using …

Posted by GitBox <gi...@apache.org>.
JaroslavTulach merged pull request #1855: InputStream.read(<array>) may read less bytes than requested - using …
URL: https://github.com/apache/netbeans/pull/1855
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


[GitHub] [netbeans] jlahoda commented on issue #1855: InputStream.read() may read less bytes than requested - using …

Posted by GitBox <gi...@apache.org>.
jlahoda commented on issue #1855: InputStream.read(<array>) may read less bytes than requested - using …
URL: https://github.com/apache/netbeans/pull/1855#issuecomment-572407555
 
 
   I was experimenting with an org.netbeans.modules.sendopts Option that was printing compiler_commands.json on System.out  - and it almost always didn't print the full json. So I was digging, and it turned out these reads didn't read the full array.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists