activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jiri Daněk (JIRA) <j...@apache.org>
Subject [jira] [Updated] (ARTEMIS-1412) Coverity: Use of freed resources in LargeMessageControllerImpl.java
Date Wed, 24 Jan 2018 16:41:00 GMT

     [ https://issues.apache.org/jira/browse/ARTEMIS-1412?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jiri Daněk updated ARTEMIS-1412:
--------------------------------
    Priority: Trivial  (was: Minor)

> 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
(v7.6.3#76005)

Mime
View raw message