axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henrik Nordberg (JIRA)" <>
Subject [jira] Commented: (AXISCPP-707) Incorrect use of delete in AxisEngineException::processException()
Date Thu, 23 Jun 2005 18:12:09 GMT
    [ ] 

Henrik Nordberg commented on AXISCPP-707:

This bug has two parts. The first part was fixed by using the correct delete operator (i.e.,
delete[] ). The second part is STILL A SERIOUS BUG:

In the function XMLParserFactory::loadLib() in the file XMLParserFactory.cpp, this snippet
of code has a bug:


PLATFORM_LOADLIB_ERROR is defined as a constant character pointer (which in this case is "").
But the semantics of the AxisEngineException requires that you pass in a char* and transfer
ownership to AxisEngineException.

So you MUST NOT pass in PLATFORM_LOADLIB_ERROR as the second argument above. You MUST make
a copy using operator new.

The problem is really the design of AxisEngineException. It should use std::string and not
char*. It is too error prone (and is probably just one of the bugs that have or will result
from it).

> Incorrect use of delete in AxisEngineException::processException()
> ------------------------------------------------------------------
>          Key: AXISCPP-707
>          URL:
>      Project: Axis-C++
>         Type: Bug
>   Components: Server - Engine
>     Versions: current (nightly)
>  Environment: Windows XP Pro, VS2003
>     Reporter: Henrik Nordberg
>     Assignee: Dushshantha Chandradasa
>     Priority: Critical

> There is a delete statement in AxisEngineException::processException() which 
> has a couple of problems:
> First, if you were supposed to delete the pointer passed in, delete[] should 
> be used (in C++). But, at least in the case of the exception thrown when a 
> library fails to load, a constant character pointer is passed in (in this 
> case "") -- see this line in XMLParserFactory::loadLib():
> Why not just use a const std::string& instead of char*?

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message