Opened 11 years ago

Closed 11 years ago

#4055 closed defect (fixed)

OGR SQL: Crashes when evaluating SUBSTR with invalid offset/size, or with CAST() to invalid typename

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 1.8.1
Component: OGR_SF Version: 1.8.0
Severity: normal Keywords: ogr sql substr cast
Cc:

Description

The following expressions cause a segfault :

ogrinfo ../autotest/ogr/data/poly.shp -sql "select substr(prfedea,-2100000000) from poly"

ogrinfo ../autotest/ogr/data/poly.shp -sql "select substr(prfedea,0,-2100000000) from poly"

ogrinfo ../autotest/ogr/data/poly.shp -sql "select substr(prfedea,0, cast(2 as int)) from poly"

Change History (1)

comment:1 by Even Rouault, 11 years ago

Resolution: fixed
Status: newclosed

r22270 /trunk/gdal/ogr/swq_op_general.cpp: OGR SQL: fix crashes when evaluating SUBSTR with invalid offset/size, or with CAST() to invalid typename (#4055)

r22271 /branches/1.8/gdal/ogr/swq_op_general.cpp: OGR SQL: fix crashes when evaluating SUBSTR with invalid offset/size, or with CAST() to invalid typename (#4055)

Note: See TracTickets for help on using tickets.