Add better frame size validation for AMQP#2167
Conversation
Add a negative size check for AMQP NIO transports. This also adds a similar check to OpenWire. For OpenWire the same IllegalArgumentException is thrown but this improves the error message in the NIO transport.
tabish121
left a comment
There was a problem hiding this comment.
The changes seem fine, unsure how well covered this is in the test suite though so not sure if you want to add any additional tests for these conditions.
I didn't add anything because I didn't think it would be very easy to fake a negative value for AMQP with the client, unless you have any suggestions. I suppose just doing some mocking or calling the validation directly would be the only option otherwise. |
Why would you need a client when AmqpWireFormat
I don't think you'd need a client or proton to test it since the NIO bit reads from a DataInput and the AmqpFrameParser reads from a ByteBuffer so you can just simulate the values |
Add a negative size check for AMQP NIO transports. This also adds a similar check to OpenWire. For OpenWire the same IllegalArgumentException is thrown but this improves the error message in the NIO transport. (cherry picked from commit 6e9dd5b)
Add a negative size check for AMQP NIO transports. This also adds a similar check to OpenWire. For OpenWire the same IllegalArgumentException is thrown but this improves the error message in the NIO transport. (cherry picked from commit 6e9dd5b)
Add a negative size check for AMQP NIO transports. This also adds a similar check to OpenWire. For OpenWire the same IllegalArgumentException is thrown but this improves the error message in the NIO transport.