carterkozak commented on code in PR #351:
URL: 
https://github.com/apache/httpcomponents-core/pull/351#discussion_r904116599


##########
httpcore5-h2/src/main/java/org/apache/hc/core5/http2/impl/nio/H2OnlyClientProtocolNegotiator.java:
##########
@@ -131,7 +134,10 @@ public void outputReady(final IOSession session) throws 
IOException {
     @Override
     public void inputReady(final IOSession session, final ByteBuffer src) 
throws IOException {
         if (src != null) {
-            throw new ProtocolNegotiationException("Unexpected input");
+            if (inBuf == null) {
+                inBuf = BufferedData.allocate(src.remaining());
+            }
+            inBuf.put(src);

Review Comment:
   I think we need to handle a potential buffer overflow here in the case an 
existing `inBuf` doesn't have enough room for `src`



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to