You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Emanuel Norrbin (JIRA)" <ax...@ws.apache.org> on 2006/01/26 00:53:09 UTC

[jira] Created: (AXISCPP-920) Use of deleted pointer in NonPositiveInteger::serialize

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


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


[jira] Commented: (AXISCPP-920) Use of deleted pointer in NonPositiveInteger::serialize

Posted by "Adrian Dick (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXISCPP-920?page=comments#action_12364072 ] 

Adrian Dick commented on AXISCPP-920:
-------------------------------------

I'm a little confused as to what code you're currently using.

It appears to me that you're working with the code in the old CVS repository, rather than the SVN repository - the web services projects migrated across at the end of August.

Looking in the SVN log, the section of code above was removed in September, as can be seen here: http://svn.apache.org/viewcvs.cgi/webservices/axis/trunk/c/src/soap/xsd/NonPositiveInteger.cpp?rev=280324&r1=264831&r2=280324&diff_format=h

Instructions for obtaining the latest code from SVN can be found here: http://ws.apache.org/axis/cpp/developers-guide.html#checkingOut

> 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

>
> 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


[jira] Commented: (AXISCPP-920) Use of deleted pointer in NonPositiveInteger::serialize

Posted by "Emanuel Norrbin (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXISCPP-920?page=comments#action_12364119 ] 

Emanuel Norrbin commented on AXISCPP-920:
-----------------------------------------

It seems that the code in the latest svn drop indeed is very different.
Sorry for the mistake, could someone please change the status of this issue to resolved.

/Thanks
Emanuel


> 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

>
> 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


[jira] Commented: (AXISCPP-920) Use of deleted pointer in NonPositiveInteger::serialize

Posted by "Emanuel Norrbin (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXISCPP-920?page=comments#action_12364107 ] 

Emanuel Norrbin commented on AXISCPP-920:
-----------------------------------------

I was not aware of this, I assumed that the CVS and SVN repositories were in sync since the nightly CVS drop is available at
http://ws.apache.org/axis/interim.html and there is a link to it from the main axis page. Maybe you should put up a nightly drop of
the SVN code instead?

/Emanuel


> 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

>
> 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


[jira] Closed: (AXISCPP-920) Use of deleted pointer in NonPositiveInteger::serialize

Posted by "nadir amra (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-920?page=all ]

nadir amra closed AXISCPP-920.
------------------------------


> Use of deleted pointer in NonPositiveInteger::serialize
> -------------------------------------------------------
>
>                 Key: AXISCPP-920
>                 URL: http://issues.apache.org/jira/browse/AXISCPP-920
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: Serialization
>    Affects 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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


[jira] Resolved: (AXISCPP-920) Use of deleted pointer in NonPositiveInteger::serialize

Posted by "Adrian Dick (JIRA)" <ax...@ws.apache.org>.
     [ 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