Opened 9 years ago

Closed 9 years ago

#6007 closed defect (fixed)

OGRCARTODBTableLayer::GetLayerDefnInternal() can access field of index -1

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 2.0.1
Component: OGR_SF Version: 2.0.0
Severity: normal Keywords: cartodb
Cc:

Description

Seen when running Valgrind on ogr_cartodb.py :

  TEST: ogr_cartodb_vsimem ... ==21679== Invalid read of size 4
==21679==    at 0x836C5AD: OGRFeature::IsFieldSet(int) (ogrfeature.cpp:1141)
==21679==    by 0x8041245: OGRCARTODBTableLayer::GetLayerDefnInternal(json_object*) (ogrcartodbtablelayer.cpp:189)
==21679==    by 0x803ED13: OGRCARTODBLayer::GetLayerDefn() (ogrcartodblayer.cpp:92)
==21679==    by 0x8141F24: OGR_L_GetLayerDefn (ogrlayer.cpp:996)
==21679==    by 0x162549FD: _wrap_Layer_GetLayerDefn (ogr_wrap.cpp:3618)
==21679==    by 0x571B57: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==21679==    by 0x5747BF: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==21679==    by 0x56DA47: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==21679==    by 0x56DC91: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==21679==    by 0x56DC91: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==21679==    by 0x56DC91: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==21679==    by 0x5747BF: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==21679==  Address 0x17176210 is 16 bytes before a block of size 16 alloc'd
==21679==    at 0x4C2B6CD: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21679==    by 0x7E6ACF3: VSIMalloc (cpl_vsisimple.cpp:505)
==21679==    by 0x7E17D4C: CPLMalloc (cpl_conv.cpp:137)
==21679==    by 0x836B296: OGRFeature::OGRFeature(OGRFeatureDefn*) (ogrfeature.cpp:71)
==21679==    by 0x803ED7F: OGRCARTODBLayer::BuildFeature(json_object*) (ogrcartodblayer.cpp:105)
==21679==    by 0x803F577: OGRCARTODBLayer::GetNextRawFeature() (ogrcartodblayer.cpp:249)
==21679==    by 0x8040631: OGRCARTODBResultLayer::GetNextRawFeature() (ogrcartodbresultlayer.cpp:84)
==21679==    by 0x803F5C6: OGRCARTODBLayer::GetNextFeature() (ogrcartodblayer.cpp:265)
==21679==    by 0x804065D: OGRCARTODBResultLayer::IsOK() (ogrcartodbresultlayer.cpp:94)
==21679==    by 0x803E55E: OGRCARTODBDataSource::ExecuteSQLInternal(char const*, OGRGeometry*, char const*, int) (ogrcartodbdatasource.cpp:707)
==21679==    by 0x8040FA1: OGRCARTODBTableLayer::GetLayerDefnInternal(json_object*) (ogrcartodbtablelayer.cpp:157)
==21679==    by 0x803ED13: OGRCARTODBLayer::GetLayerDefn() (ogrcartodblayer.cpp:92)

Change History (1)

comment:1 by Even Rouault, 9 years ago

Milestone: 2.0.1
Resolution: fixed
Status: newclosed
Version: unspecified2.0.0

trunk r29404, branches/2.0 r29405 "CartoDB: fix invalid read of memory in OGRCARTODBTableLayer::GetLayerDefnInternal() (#6007)"

Note: See TracTickets for help on using tickets.