oscerd commented on PR #28846: URL: https://github.com/apache/camel/pull/28846#issuecomment-6574683558
Pushed the commit "CAMEL-26481: Address review feedback - reject a length field that does not fit an int, test the rejected frames" for the review. - **Overflow** (@davsclaus, @gnodet-bot): the digit loop throws as soon as the next digit would take the value past `Integer.MAX_VALUE - 1` (the frame is read as `length + 1` bytes), so `4294967296` and `2147483647` are rejected instead of wrapping; a ten-digit field that fits (`2147483646`) is still accepted. - A rejected length field now also drops the buffered bytes: the stream cannot be re-synchronised past it, the netty consumer closes the connection on the exception, and without the drop `ByteToMessageDecoder` decoded the same bytes once more on close and raised the exception a second time. - **Tests**: the empty, non-digit and two overflowing length fields (asserting the `DecoderException` and its message), the largest accepted field, and `testFragmentedLengthDigitsAcrossPackets` rewritten so it fails on the previous decoder (a complete frame followed by split digits, which used to be replayed). - The regenerated `SyslogDataFormatConfigurer` was already restored by the "Regen" commit, so the PR is back to the decoder and its test. camel-syslog module tests: 40 run, 0 failures (JDK 21). Re-requested the review on the new head. _Claude Code on behalf of oscerd_ -- 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]
