Opened 18 years ago
Last modified 18 years ago
#1512 closed defect (fixed)
osr.ImportFromESRI() method crashes on valid input
Reported by: | dron | Owned by: | hobu |
---|---|---|---|
Priority: | highest | Milestone: | |
Component: | PythonBindings | Version: | unspecified |
Severity: | critical | Keywords: | |
Cc: |
Description
In order to reproduce this bug just start a Python interpreter: >>> from osr import * >>> o = SpatialReference() >>> o.ImportFromESRI("""GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]]""") Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1210104128 (LWP 8544)] 0xb78feca8 in OGRSpatialReference::importFromESRI (this=0x81d4bb0, papszPrj=0xbf9f12e4) at ogr_srs_esri.cpp:612 612 CPLRealloc(pszWKT,strlen(pszWKT)+strlen(papszPrj[i])+1); Current language: auto; currently c++ (gdb) bt #0 0xb78feca8 in OGRSpatialReference::importFromESRI (this=0x81d4bb0, papszPrj=0xbf9f12e4) at ogr_srs_esri.cpp:612 #1 0xb78ffbc2 in OSRImportFromESRI (hSRS=0x81d4bb0, papszPrj=0xbf9f12e4) at ogr_srs_esri.cpp:431 #2 0xb7ad00b4 in _wrap_SpatialReference_ImportFromESRI (args=0xb7d7cfec) at osr_wrap.cpp:3098 #3 0x080589d7 in PyObject_Call () #4 0x080b7e1c in PyEval_EvalFrame () #5 0x080ba735 in PyEval_EvalCodeEx () #6 0x080b87bb in PyEval_EvalFrame () #7 0x080ba735 in PyEval_EvalCodeEx () #8 0x080ba799 in PyEval_EvalCode () #9 0x080dc985 in PyRun_InteractiveOneFlags () #10 0x080dcaa0 in PyRun_InteractiveLoopFlags () #11 0x080dd5a2 in PyRun_AnyFileExFlags () #12 0x08055ba8 in Py_Main () #13 0x08055032 in main () (gdb) p i $3 = 3 (gdb) p papszPrj[i] $4 = 0x2 <Address 0x2 out of bounds> I am understand that input for osr.ImportFromESRI() fucntion should be a list, not a string, but we should get an exception instead of crash. I do not undestand in deep the NG bindings, so I am prefer to fill report instead of digging into the problem myself. Best regards, Andrey
Note:
See TracTickets
for help on using tickets.