Ticket #2386 (closed defect: fixed)

Opened 3 months ago

Last modified 3 months ago

OGR / SQL: crash in OGRDataSource::ExecuteSQL with an empty SQL query

Reported by: actcorp Assigned to: rouault
Priority: normal Milestone: 1.5.2
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: ogr sql
Cc:

Description

OGRDataSource *poDS;

...

OGRLayer *rs = poDS->ExecuteSQL( sql_query, NULL, "" );

Ends up in a crash if the first argument is an empty string, i.e. strlen( sql_query ) == 0

The problem seems to show up in: file: ogr/swq.c function: swq_select_preparse() (maybe the current token could become NULL if the select_statement is empty ?)

If so, strcasecmp will crash (!)

Change History

05/22/08 13:32:30 changed by rouault

  • owner changed from warmerdam to rouault.

05/22/08 13:39:54 changed by rouault

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in trunk in r14504 and in branches/1.5 in r14505