Opened 13 years ago

Closed 11 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:
Cc:

Description

valgrind --trace-children=yes python swig/python/scripts/gdal_fillnodata.py 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 13 years ago.
gdalfillnodata.uninitialized.patch (479 bytes ) - added by akhliustov 11 years ago.

Download all attachments as: .zip

Change History (4)

by Even Rouault, 13 years ago

Attachment: byte.asc added

by akhliustov, 11 years ago

comment:1 by akhliustov, 11 years ago

0 seems to be a reasonable value.

comment:2 by Even Rouault, 11 years ago

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.