Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when applying wrong filter to OAFeat layer #33878

Closed
gioman opened this issue Jan 17, 2020 · 3 comments · Fixed by #33927
Closed

Crash when applying wrong filter to OAFeat layer #33878

gioman opened this issue Jan 17, 2020 · 3 comments · Fixed by #33927
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Provider Related to specific vector, raster or mesh data providers

Comments

@gioman
Copy link
Contributor

gioman commented Jan 17, 2020

QGIS master on Windows.

Create a WFS / OGC API connection to https://pta.spatineo-devops.com/sofp/?f=json

Connect to the service

Choose a layer and double click to open a dialog that allows to create a filter with an expression

Enter a filter/expression that is based on a column name that does not actually exist in the layer, i.e. "test"=1

Click "test" or "ok" > crash

@gioman gioman added Data Provider Related to specific vector, raster or mesh data providers Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption labels Jan 17, 2020
@rouault rouault changed the title Crash when applying wrong filter to WFS layer Crash when applying wrong filter to OAFeat layer Jan 17, 2020
@rouault rouault self-assigned this Jan 17, 2020
@gioman gioman changed the title Crash when applying wrong filter to OAFeat layer Crash when applying wrong filter to WFS layer Jan 17, 2020
@rouault
Copy link
Contributor

rouault commented Jan 20, 2020

@gioman Side remark: my proposed modified title for the issue was more specific I think that "WFS". The layer pointed is a OAFeat (OGC API Feature) one, not a WFS one.

@rouault
Copy link
Contributor

rouault commented Jan 20, 2020

oops above remark was meant for @gioman

@gioman
Copy link
Contributor Author

gioman commented Jan 20, 2020

The layer pointed is a OAFeat (OGC API Feature) one, not a WFS one.

@rouault correct, thanks!

@gioman gioman changed the title Crash when applying wrong filter to WFS layer Crash when applying wrong filter to OAFeat layer Jan 20, 2020
rouault added a commit to rouault/QGIS that referenced this issue Jan 20, 2020
If the expression was referencing a non-existing field, -1 was returned in the
result set, which caused later crashed in various providers, including the
Spatialite, Postgres, etc..., due to tried to dereference mFields.at(-1)

Discarding invalid indices is what is also done in
QgsFeatureRequest::OrderBy::usedAttributeIndices()

Fixes qgis#33878
nyalldawson pushed a commit that referenced this issue Jan 21, 2020
If the expression was referencing a non-existing field, -1 was returned in the
result set, which caused later crashed in various providers, including the
Spatialite, Postgres, etc..., due to tried to dereference mFields.at(-1)

Discarding invalid indices is what is also done in
QgsFeatureRequest::OrderBy::usedAttributeIndices()

Fixes #33878
rouault added a commit to rouault/QGIS that referenced this issue Jan 21, 2020
If the expression was referencing a non-existing field, -1 was returned in the
result set, which caused later crashed in various providers, including the
Spatialite, Postgres, etc..., due to tried to dereference mFields.at(-1)

Discarding invalid indices is what is also done in
QgsFeatureRequest::OrderBy::usedAttributeIndices()

Fixes qgis#33878
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption Data Provider Related to specific vector, raster or mesh data providers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants