ing-mattioni commented on code in PR #11242:
URL: https://github.com/apache/nifi/pull/11242#discussion_r3257462840


##########
nifi-extension-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/PublishAMQP.java:
##########
@@ -220,7 +226,7 @@ public void migrateProperties(final PropertyConfiguration 
config) {
      * Extracts contents of the {@link FlowFile} as byte array.
      */
     private byte[] extractMessage(final FlowFile flowFile, ProcessSession 
session) {
-        final byte[] messageContent = new byte[(int) flowFile.getSize()];
+        final byte[] messageContent = new 
byte[Math.toIntExact(flowFile.getSize())];

Review Comment:
   Resolved by checking against the configured size limit before allocation, so 
the remaining cast is bounded.



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

Reply via email to