rabbitmq / rabbitmq-java-client

RabbitMQ Java client
https://www.rabbitmq.com/java-client.html
Other
1.24k stars 572 forks source link

Invalid value check in NioParams.setWriteByteBufferSize #1309

Closed malliaridis closed 3 months ago

malliaridis commented 3 months ago

Describe the bug

The function NioParams#setWriteByteBufferSize(int writeByteBufferSize) does not check the bounces of the passed argument writeByteBufferSize, but the readbyteBufferSize instead.

Reproduction steps

  1. Create an instance of NioParams
  2. Call setWriteByteBufferSize(-1)

Expected behavior

The bounces of the argument writebyteBufferSize are checked / An IllegalArgumentException is thrown for negative writeByteBufferSizes.

Additional context

It looks like a copy-paste mistake from NioParams.setReadByteBufferSize(int readByteBufferSize).

acogoluegnes commented 3 months ago

Fixed, thanks!