You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/09/07 07:27:22 UTC

[jira] [Commented] (ARTEMIS-713) Possible integer overflow in SubscriptionsResource.recreateTopicConsumer

    [ https://issues.apache.org/jira/browse/ARTEMIS-713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15469855#comment-15469855 ] 

ASF GitHub Bot commented on ARTEMIS-713:
----------------------------------------

GitHub user MartinStyk opened a pull request:

    https://github.com/apache/activemq-artemis/pull/755

    ARTEMIS-713 Possible integer overflow in SubscriptionsResource.recrea…

    …teTopicConsumer
    
    Artemis Jira: https://issues.apache.org/jira/browse/ARTEMIS-713

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MartinStyk/activemq-artemis ARTEMIS-713

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/755.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #755
    
----
commit 78409ae5e92804d3638eac918d567e96988be03d
Author: Martin Styk <ms...@redhat.com>
Date:   2016-09-07T07:25:57Z

    ARTEMIS-713 Possible integer overflow in SubscriptionsResource.recreateTopicConsumer

----


> Possible integer overflow in SubscriptionsResource.recreateTopicConsumer
> ------------------------------------------------------------------------
>
>                 Key: ARTEMIS-713
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-713
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 1.3.0
>            Reporter: Martin Styk
>            Priority: Trivial
>
> _Code_
> {code:java}
> private QueueConsumer recreateTopicConsumer(String subscriptionId, boolean autoAck) {
>       QueueConsumer consumer;
>       if (subscriptionExists(subscriptionId)) {
>          QueueConsumer tmp = null;
>          try {
>                 tmp = createConsumer(true, autoAck, subscriptionId, null, consumerTimeoutSeconds * 1000, false);
>           }
> {code}
> _Issue_
> Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)overflow_before_widen: Potentially overflowing expression consumerTimeoutSeconds * 1000 with type int (32 bits, signed) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type long (64 bits, signed).
>    To avoid overflow, cast either consumerTimeoutSeconds or 1000 to type long.
> This is small issue, but it is nice to have it fixed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)