Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 61469 invoked from network); 9 Feb 2010 01:53:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2010 01:53:56 -0000 Received: (qmail 90138 invoked by uid 500); 9 Feb 2010 01:53:55 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 90088 invoked by uid 500); 9 Feb 2010 01:53:55 -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 90078 invoked by uid 99); 9 Feb 2010 01:53:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 01:53:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Feb 2010 01:53:54 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 823D5234C052 for ; Mon, 8 Feb 2010 17:53:34 -0800 (PST) Message-ID: <934895962.13931265680414527.JavaMail.jira@brutus.apache.org> Date: Tue, 9 Feb 2010 01:53:34 +0000 (UTC) From: "yojay.li (JIRA)" To: dev@activemq.apache.org Subject: [jira] Created: (AMQCPP-285) If brokerURI is ipv4 format(127.0.0.1), createConnection will throw decaf::lang::exceptions::NumberFormatException. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c If brokerURI is ipv4 format(127.0.0.1), createConnection will throw decaf::lang::exceptions::NumberFormatException. -------------------------------------------------------------------------------------------------------------------- Key: AMQCPP-285 URL: https://issues.apache.org/activemq/browse/AMQCPP-285 Project: ActiveMQ C++ Client Issue Type: Bug Components: Decaf Affects Versions: 3.1 Environment: vs2008,windows xp Reporter: yojay.li Assignee: Timothy Bish file: activemq-cpp-library-3.1.0\src\main\decaf\internal\net\URIHelper.cpp funciton: bool URIHelper::isValidIPv4Address( const std::string& host ) cause: The paramters of std::string.substr() is (start_pos, length) but not (start_pos, end_pos). Interger::parseInt(host.substr(..., ...)) will throw NumberFormatException. fixed code: bool URIHelper::isValidIPv4Address( const std::string& host ) { std::size_t index; std::size_t index2; try { int num; index = host.find( '.' ); num = decaf::lang::Integer::parseInt( host.substr( 0, index ) ); if( num < 0 || num > 255 ) { return false; } index2 = host.find( '.', index + 1 ); num = decaf::lang::Integer::parseInt( host.substr( index + 1, index2 - index - 1) ); if( num < 0 || num > 255 ) { return false; } index = host.find( '.', index2 + 1 ); num = decaf::lang::Integer::parseInt( host.substr( index2 + 1, index - index2 - 1) ); if( num < 0 || num > 255 ) { return false; } num = decaf::lang::Integer::parseInt( host.substr( index + 1, std::string::npos ) ); if( num < 0 || num > 255 ) { return false; } } catch( decaf::lang::Exception& e ) { return false; } return true; } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.