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 "nadir amra (JIRA)" <ax...@ws.apache.org> on 2006/08/12 06:54:14 UTC

[jira] Commented: (AXISCPP-770) const AnyElement* XMLParserXerces::next(bool isCharData) crashes

    [ http://issues.apache.org/jira/browse/AXISCPP-770?page=comments#action_12427676 ] 
            
nadir amra commented on AXISCPP-770:
------------------------------------

Adding note on the forum by Kamlesh kumar <ka...@yahoo.com> related to this:

The current implementation of XMLParserXerces ignores
the  value returned by the parseNext() call, this
causes the program to crash the next time parseNext()
is called. 

Here is a sample code inside the peek function
illustrating the problem. 

AnyElement* elem = m_Xhandler.getAnyElement();
        while (CHARACTER_ELEMENT == elem->m_type) /
        { /* ignorable white space */
            m_Xhandler.freeElement();
            bCanParseMore =
m_pParser->parseNext(m_ScanToken);
            elem = m_Xhandler.getAnyElement();
         }

It has two problems one it ignores the value of
bCanParseMore and secondly it doesn't check if elem is
null or not before entering the while loop again. 

Ideally, once the parser returns a value of
false(indicating the end of stream) we shouldn't be
calling parseNext() function. I think it would be
better to have a class member variable called
m_bCanParseMore which we check before making any call
to parseNext function. This would avoid the problem.

I run into this situation more often as I am using the
SoapDeSerializer API directly.

> const AnyElement* XMLParserXerces::next(bool isCharData) crashes
> ----------------------------------------------------------------
>
>                 Key: AXISCPP-770
>                 URL: http://issues.apache.org/jira/browse/AXISCPP-770
>             Project: Axis-C++
>          Issue Type: Bug
>          Components: Parser Library - Xerces
>    Affects Versions: 1.5 Final
>         Environment: linux 2.6.11
>            Reporter: jose
>
> The function const AnyElement* XMLParserXerces::next(bool isCharData) of XMLParserXerces.cpp crashes on the next line:
>                 bCanParseMore = m_pParser->parseNext(m_ScanToken);
> I have tested with xerces 2.2 and with xerces 2.6 and the problem continues.
> If I HTTP GET the Web Services List via http://localhost:8080/axis/ the parser works fine for the server.wsdd file, but when I
> call the web service example Calculator and the engine tries to parse the soap request in process(), then crashes.
> P.D.: Please, migrate to stable xerces 2.6

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