Opened 9 years ago
Closed 9 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 by , 9 years ago
comment:2 by , 9 years ago
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 by , 9 years ago
Milestone: | → 1.11.2 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
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 ?