Ticket #2386 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

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

Reported by: actcorp Owned by: 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

Changed 4 years ago by rouault

  • owner changed from warmerdam to rouault

Changed 4 years ago by rouault

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

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

Note: See TracTickets for help on using tickets.