Opened 7 years ago

Closed 7 years ago

#5778 closed defect (fixed)

Use of uninitialized memory in OGRLayer::Update()

Reported by: Even Rouault Owned by: warmerdam
Priority: normal Milestone: 1.11.2
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc: Ari Jolma

Description

There are Valgrind warnings at the line :

if (mapMethod) z->SetFieldsFrom?(y, mapMethod);

due to mapMethod not being initialized since set_result_schema() is called in non-combined mode

Change History (3)

comment:1 Changed 7 years ago by Even Rouault

trunk r28161 "OGR layer algebra: properly initialize field maps to avoid Valgrind warnings in OGRLayer::Update() (#5778)"

I'm not sure if the line z->SetFieldsFrom??(y, mapMethod); should be removed, or if set_result_schema() should be called with combined = 1. Ari, any opinion ?

comment:2 Changed 7 years ago by Ari Jolma

Seems to me that the description of the method is which we should read. By default the result gets attributes only from the input layer and not from the method layer. Thus combined = 0. However, by the 1. comment (whose english may be broken), if the user sets the schema, then the result features may get attribute values from method features, thus the SetFieldsFrom? call is needed.

comment:3 Changed 7 years ago by Even Rouault

Milestone: 1.11.2
Resolution: fixed
Status: newclosed

Thanks Ari

trunk r28168 "Remove unneeded FIXME" branches/1.11 r28169 "OGR layer algebra: properly initialize field maps to avoid Valgrind warnings in Oyer::Update() (#5778)"

Note: See TracTickets for help on using tickets.