#2767 closed defect (fixed)
PG driver: GetFeature(id) with an invalid id crashes OGR
Reported by: | Even Rouault | Owned by: | Even Rouault |
---|---|---|---|
Priority: | normal | Milestone: | 1.5.4 |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | pg getfeature |
Cc: | thomas.bonfort@… |
Description
In OGRPGTableLayer::GetFeature(), the following snippet should check that in addition to the successful status, the number of rows is > 0. Aditionnaly, if the number of rows is strictly > 1, we could also issue a warning!
hResult = PQexec(hPGConn, "FETCH ALL in getfeaturecursor" ); if( hResult && PQresultStatus(hResult) == PGRES_TUPLES_OK ) { hCursorResult = hResult; poFeature = RecordToFeature( 0 ); hCursorResult = NULL; }
Change History (2)
comment:1 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Type: | enhancement → defect |
Note:
See TracTickets
for help on using tickets.
Fixed in trunk in r16055, in branches/1.6 in r16056 and in branches/1.5 in r16057