On 03/07/15 16:27, Ian Jackson wrote:
Jennifer Herbert writes ("[Xen-devel] [PATCH 2/7] libxc: Use const pointer in
local_file_dump()"):
By adding the const keyword, it is clearer to people and static analysis
tools that no changes to the data are to be made.
Would it be wrong for a future patch to add a field to dump_args which
gets modified ? AFAICT the answer is `no'. So I don't understand why
it ought to be const.
Does your Coverity instance complain about every instance where a
struct exists which is not marked const but which could be ?
Coverity see da->fd being passed to local_file_dump, as a modifiable
entity and concludes this function may be overwriting this, and end up
leaking the handle.
It wouldn't be wrong to modify a new field, I just hadn't considered
that likely. Since maybe it is, I'll just mark as false positive.
-jenny
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel