You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@pekko.apache.org by GitBox <gi...@apache.org> on 2022/11/18 09:31:13 UTC

[GitHub] [incubator-pekko] jrudolph commented on a diff in pull request #44: stream: fix regression in JsonFraming

jrudolph commented on code in PR #44:
URL: https://github.com/apache/incubator-pekko/pull/44#discussion_r1026208607


##########
akka-stream/src/main/scala/akka/stream/impl/JsonObjectParser.scala:
##########
@@ -107,21 +107,22 @@ import akka.util.ByteString
     val bufSize = buffer.length
 
     skipToNextObject(bufSize)
+    val maxObjectLengthIndex = if (maximumObjectLength == Int.MaxValue) Int.MaxValue else pos + maximumObjectLength

Review Comment:
   Good point. I wonder if the code can made to work in those cases, where leading bytes to be skipped plus object will not fit into an array?
   
   We should definitely fix the condition here but might also want to add a guard to `offer` to avoid creating a new array with negative size and also throw the FramingException from below.



-- 
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: notifications-unsubscribe@pekko.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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