[
https://issues.apache.org/jira/browse/ARTEMIS-1412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Justin Bertram resolved ARTEMIS-1412.
-------------------------------------
Resolution: Not A Problem
> Coverity: Use of freed resources in LargeMessageControllerImpl.java
> -------------------------------------------------------------------
>
> Key: ARTEMIS-1412
> URL: https://issues.apache.org/jira/browse/ARTEMIS-1412
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: Broker
> Affects Versions: 2.4.0
> Reporter: Jiri Daněk
> Priority: Trivial
>
> {noformat}
> 245 synchronized (this) {
> 1. Condition currentPacket != null, taking true branch.
> 246 if (currentPacket != null) {
> 2. object_freed: sendPacketToOutput frees output. [show details]
> 247 sendPacketToOutput(output, currentPacket);
> 248 currentPacket = null;
> 249 }
> 3. Condition handledException == null, taking true branch.
> 250 while (handledException == null) {
> 251 LargeData packet = largeMessageData.poll();
> 4. Condition packet == null, taking false branch.
> 252 if (packet == null) {
> 253 break;
> 254 }
> 255 totalFlowControl += packet.getFlowControlSize();
> 256
> 257 continues = packet.isContinues();
>
> CID 1409518: Use of freed resources (USE_AFTER_FREE)
> 5. use_after_free: sendPacketToOutput uses freed object output. [show details]
> 258 sendPacketToOutput(output, packet);
> 259 }
> 260
> 261 checkException();
> 262 outStream = output;
> 263 }
> 264
> {noformat}
> {noformat}
> 69 private void sendPacketToOutput(final OutputStream output, final
> LargeData packet) throws ActiveMQException {
> 1070 try {
> 1071 output.write(packet.getChunk());
> 1. Condition !packet.isContinues(), taking true branch.
> 1072 if (!packet.isContinues()) {
> 1073 streamEnded = true;
> 2. object_freed: close frees parameter output.
> 1074 output.close();
> 1075 }
> 1076 } catch (IOException e) {
> 1077 throw
> ActiveMQClientMessageBundle.BUNDLE.errorWritingLargeMessage(e);
> 1078 }
> 1079 }
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)