Opened 6 years ago

Closed 4 years ago

#4010 closed defect (fixed)

GDALFillNoData(): use of uninitialized memory

Reported by: Even Rouault Owned by: warmerdam
Priority: normal Milestone: 1.10.1
Component: Algorithms Version: unspecified
Severity: normal Keywords:


valgrind --trace-children=yes python swig/python/scripts/ byte.asc out.tif

reveals :

Conditional jump or move depends on uninitialised value(s)
==20666==    at 0x710968B: GDALFillNodata (rasterfill.cpp:707)
==20666==    by 0x666524E: FillNodata(void*, void*, double, int, char**, int (*)(double, char const*, void*), void*) (gdal_wrap.cpp:4669)
==20666==    by 0x66696E2: _wrap_FillNodata (gdal_wrap.cpp:18021)
==20666==    by 0x4A8783: PyEval_EvalFrameEx (in /usr/bin/python2.6)
==20666==    by 0x4A9670: PyEval_EvalCodeEx (in /usr/bin/python2.6)
==20666==    by 0x4A9741: PyEval_EvalCode (in /usr/bin/python2.6)
==20666==    by 0x4C9A0D: PyRun_FileExFlags (in /usr/bin/python2.6)
==20666==    by 0x4C9C23: PyRun_SimpleFileExFlags (in /usr/bin/python2.6)
==20666==    by 0x41A7FE: Py_Main (in /usr/bin/python2.6)
==20666==    by 0x5EECC4C: (below main) (libc-start.c:226)

I presume this is due to the double adfQuadValue[4]; at line 694 not being initialized, but being tested in the QUAD_CHECK() macro in if( quad_value != nNoDataVal ). I am not sure which value should be used to initialize adfQuadValue[i] : 0 ?

Attachments (2)

byte.asc (1.7 KB) - added by Even Rouault 6 years ago.
gdalfillnodata.uninitialized.patch (479 bytes) - added by akhliustov 4 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by Even Rouault

Attachment: byte.asc added

Changed 4 years ago by akhliustov

comment:1 Changed 4 years ago by akhliustov

0 seems to be a reasonable value.

comment:2 Changed 4 years ago by Even Rouault

Milestone: 1.10.1
Resolution: fixed
Status: newclosed

trunk r26340, branches/1.10 r26341 "GDALFillNodata(): Fix use of uninitialized memory and integer overflows (#4010, #5203)"

Note: See TracTickets for help on using tickets.