Opened 11 years ago

Closed 11 years ago

#2386 closed defect (fixed)

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

Reported by: actcorp Owned by: Even 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 (2)

comment:1 Changed 11 years ago by Even Rouault

Owner: changed from warmerdam to Even Rouault

comment:2 Changed 11 years ago by Even Rouault

Resolution: fixed
Status: newclosed

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

Note: See TracTickets for help on using tickets.