Opened 7 years ago

Closed 7 years ago

#5571 closed defect (fixed)

OGR Driver GML : bug with gmlReader multiple instanciation/deletion ( using xerces)

Reported by: ibibah Owned by: warmerdam
Priority: normal Milestone: 1.11.1
Component: default Version: 1.11.0
Severity: major Keywords: Driver, GML, xerces
Cc:

Description (last modified by ibibah)

there is a bug in the gmlReader object here:

209	    if( m_nInstanceCount == 0 && m_bXercesInitialized > 0 )
210	    {
211	        XMLPlatformUtils::Terminate();
212	        m_bXercesInitialized = FALSE;   <----- here
213	    }

he's using two global variables to manage xerces initialisation. If, in one session, you're allocate a object , delete them, and reallocate another, m_bXercesInitialized = FALSE instead of -1 like the global initialisation. This result in a crash when whe call NextFeatureXerces?() because, SetupParser?() and then SetupParserXerces?() doesn't allocate the reader and m_poSAXReader == NULL in the code below :

555	        while( m_poCompleteFeature == NULL 
556	               && !m_bStopParsing
557	               && m_poSAXReader->parseNext( m_oToFill ) ) {}

The correction is :

209	    if( m_nInstanceCount == 0 && m_bXercesInitialized > 0 )
210	    {
211	        XMLPlatformUtils::Terminate();
212	        m_bXercesInitialized = -1;   <----- correction
213	    }

Please correct this.

thanks.

Change History (4)

comment:1 Changed 7 years ago by ibibah

Milestone: 1.11.1

comment:2 Changed 7 years ago by ibibah

Description: modified (diff)

comment:3 Changed 7 years ago by ibibah

Keywords: Driver GML xercesDriver,GML,xerces

comment:4 Changed 7 years ago by Even Rouault

Resolution: fixed
Status: newclosed

trunk r27530, branches/1.11 r27531 "GML: fix bug that prevented multiple instanciation of the reader with Xerces backend (#5571)"

trunk r27532 "Test multiple instanciation of parser (#5571)"

Note: See TracTickets for help on using tickets.