activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "james strachan (JIRA)" <j...@apache.org>
Subject [jira] Moved: (AMQCPP-71) Missing NULL pointer check in MessageConsumer::autoAcknowledge
Date Tue, 27 Feb 2007 10:47:03 GMT

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

james strachan moved AMQ-824 to AMQCPP-71:
------------------------------------------

          Component/s:     (was: CMS (C++ client))
    Affects Version/s:     (was: incubation)
                  Key: AMQCPP-71  (was: AMQ-824)
              Project: ActiveMQ C++ Client  (was: ActiveMQ)

> Missing NULL pointer check in  MessageConsumer::autoAcknowledge
> ---------------------------------------------------------------
>
>                 Key: AMQCPP-71
>                 URL: https://issues.apache.org/activemq/browse/AMQCPP-71
>             Project: ActiveMQ C++ Client
>          Issue Type: Bug
>         Environment: RHEL ES 4/32bit
>            Reporter: Radek Sedmak
>         Assigned To: Nathan Mittler
>         Attachments: patch.txt
>
>   Original Estimate: 10 minutes
>  Remaining Estimate: 10 minutes
>
> When you call consumer->receive() on empty queue receive method returns NULL message
but before return MessageConsumer::autoAcknowledge method is invoked. This method doesn't
check message against NULL, this cause coredump is message is NULL.
> Patch: 
> p<IMessage> MessageConsumer::autoAcknowledge(p<IMessage> message)
> {
>     try
>     {
>         if ( message != NULL ) {   // <------ Check NULL here !!!!!
>           // Is the message an ActiveMQMessage? (throws bad_cast otherwise)
>           p<ActiveMQMessage> activeMessage = p_dyncast<ActiveMQMessage> (message)
;
>           // Register the handler for client acknowledgment
>           activeMessage->setAcknowledger( smartify(this) ) ;
>           if( acknowledgementMode != ClientAckMode )
>               doAcknowledge(activeMessage) ;
>         }
>     }
>     catch( bad_cast& bc )
>     {
>         // ignore
>     }
>     return message ;

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message