Return-Path: Delivered-To: apmail-activemq-dev-archive@www.apache.org Received: (qmail 71228 invoked from network); 9 Feb 2010 15:49:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 Feb 2010 15:49:54 -0000 Received: (qmail 11761 invoked by uid 500); 9 Feb 2010 15:49:54 -0000 Delivered-To: apmail-activemq-dev-archive@activemq.apache.org Received: (qmail 11735 invoked by uid 500); 9 Feb 2010 15:49:54 -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 11725 invoked by uid 99); 9 Feb 2010 15:49:54 -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 15:49:54 +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 15:49:53 +0000 Received: from brutus.apache.org (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 972F629A0014 for ; Tue, 9 Feb 2010 07:49:33 -0800 (PST) Message-ID: <1949877387.15121265730573618.JavaMail.jira@brutus.apache.org> Date: Tue, 9 Feb 2010 15:49:33 +0000 (UTC) From: "Timothy Bish (JIRA)" To: dev@activemq.apache.org Subject: [jira] Resolved: (AMQCPP-285) If brokerURI is ipv4 format(127.0.0.1), createConnection will throw decaf::lang::exceptions::NumberFormatException. In-Reply-To: <934895962.13931265680414527.JavaMail.jira@brutus.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c [ https://issues.apache.org/activemq/browse/AMQCPP-285?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Timothy Bish resolved AMQCPP-285. --------------------------------- Resolution: Fixed Fixed in trunk and 3.1.x fixes branch > 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 > Fix For: 3.1.1, 3.2.0 > > > 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.