Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C0BFC200B0F for ; Fri, 17 Jun 2016 14:09:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BF3AB160A61; Fri, 17 Jun 2016 12:09:16 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 13078160A50 for ; Fri, 17 Jun 2016 14:09:15 +0200 (CEST) Received: (qmail 92776 invoked by uid 500); 17 Jun 2016 12:09:15 -0000 Mailing-List: contact dev-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list dev@activemq.apache.org Received: (qmail 92765 invoked by uid 99); 17 Jun 2016 12:09:14 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jun 2016 12:09:14 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CD183E049D; Fri, 17 Jun 2016 12:09:14 +0000 (UTC) From: mtaylor To: dev@activemq.apache.org Reply-To: dev@activemq.apache.org Message-ID: Subject: [GitHub] activemq-artemis pull request #583: ARTEMIS-570 Fix buffer size overflow Pro... Content-Type: text/plain Date: Fri, 17 Jun 2016 12:09:14 +0000 (UTC) archived-at: Fri, 17 Jun 2016 12:09:16 -0000 GitHub user mtaylor opened a pull request: https://github.com/apache/activemq-artemis/pull/583 ARTEMIS-570 Fix buffer size overflow ProtonHandler There is a race condition in the ProtonHandlerImpl.outputBuffer() method. The method checks to see how many bytes (n) are pending in the underlying ProtonJ buffer, then creates a Netty buffer of size n. It then writes the contents of the pending ProtonJ head. However, ProtonJ can still write to it's internal buffer, meaning that it's buffer.size > n causing an illegalArgumentException. This patch fixes it by only writing 'n' bytes to the Netty buffer. You can merge this pull request into a Git repository by running: $ git pull https://github.com/mtaylor/activemq-artemis Artemis-570 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/activemq-artemis/pull/583.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 #583 ---- commit cc979b9de05588c58180d360cedecbdda208a9ea Author: Martyn Taylor Date: 2016-06-16T15:02:23Z ARTEMIS-570 Fix buffer size overflow ProtonHandler There is a race condition in the ProtonHandlerImpl.outputBuffer() method. The method checks to see how many bytes (n) are pending in the underlying ProtonJ buffer, then creates a Netty buffer of size n. It then writes the contents of the pending ProtonJ head. However, ProtonJ can still write to it's internal buffer, meaning that it's buffer.size > n causing an illegalArgumentException. This patch fixes it by only writing 'n' bytes to the Netty buffer. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastructure@apache.org or file a JIRA ticket with INFRA. ---