Return-Path: Delivered-To: apmail-ws-axis-c-dev-archive@www.apache.org Received: (qmail 2385 invoked from network); 27 Jan 2006 08:42:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Jan 2006 08:42:57 -0000 Received: (qmail 10215 invoked by uid 500); 27 Jan 2006 08:42:56 -0000 Delivered-To: apmail-ws-axis-c-dev-archive@ws.apache.org Received: (qmail 10195 invoked by uid 500); 27 Jan 2006 08:42:56 -0000 Mailing-List: contact axis-c-dev-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: "Apache AXIS C Developers List" Reply-To: "Apache AXIS C Developers List" Delivered-To: mailing list axis-c-dev@ws.apache.org Received: (qmail 10184 invoked by uid 99); 27 Jan 2006 08:42:55 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jan 2006 00:42:55 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 33FB0C9 for ; Fri, 27 Jan 2006 09:42:34 +0100 (CET) Message-ID: <11864628.1138351353989.JavaMail.jira@ajax.apache.org> Date: Fri, 27 Jan 2006 09:42:33 +0100 (CET) From: "Adrian Dick (JIRA)" To: axis-c-dev@ws.apache.org Subject: [jira] Resolved: (AXISCPP-920) Use of deleted pointer in NonPositiveInteger::serialize In-Reply-To: <1342623642.1138233189204.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/AXISCPP-920?page=all ] Adrian Dick resolved AXISCPP-920: --------------------------------- Fix Version: current (nightly) Resolution: Fixed Marking as resolved, as requested. > Use of deleted pointer in NonPositiveInteger::serialize > ------------------------------------------------------- > > Key: AXISCPP-920 > URL: http://issues.apache.org/jira/browse/AXISCPP-920 > Project: Axis-C++ > Type: Bug > Components: Serialization > Versions: 1.6 Final > Environment: All platforms, this issue was found in nightly CVS drop 20060125052126 > Reporter: Emanuel Norrbin > Fix For: current (nightly) > > File: soap\xsd\NonPositiveInteger.cpp > Method: AxisChar* NonPositiveInteger::serialize(const xsd__nonPositiveInteger* value) > Row: 152 - 161 > This is a snippet of the code to illustrate the problem, starting on line 152. > // ** maxInclusive is deleted. > delete maxInclusive; > MaxExclusive* maxExclusive = getMaxExclusive(); > if (maxExclusive->isSet()) > { > if ( *value <= maxExclusive->getMaxExclusiveAsUnsignedLONGLONG() ) > { > AxisString exceptionMessage = > "Value to be serialized is greater than or equal to MaxExclusive specified for this type. MaxExclusive = "; > //** Here maxInclusive is used again, after being deleted. > if (maxInclusive->getMaxInclusiveAsUnsignedLONGLONG() != 0) > { > exceptionMessage += "-"; > } > Probably line 161 should read > if (maxExclusive->getMaxExclusiveAsUnsignedLONGLONG() != 0) > or maxInclusive should not be deleted until later. > I would recommend use of std::auto_ptr to keep track of memory allocation here, > which has the added benefit of making the code exception safe. Note that this file has > numerous memory leaks in case an exception is thrown! > /Emanuel -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira