patch for samba4
tridge at samba.org
tridge at samba.org
Wed Feb 7 00:48:39 GMT 2007
Jelmer,
> > The reason: torture/rpc/rpc.c:120: warning: assignment discards
> > qualifiers from pointer target type
> > patch name: rpc.patch
> Committed, thanks.
Did you test this Jelmer?
I know it gets rid of a warning, but it doesn't look right to me. I
haven't tried it, but it looks like this will cause a crash with that
patch.
With the patch we now store the pointer like this:
const struct dcerpc_interface_table *table;
...
tcase->data = (void *)&table;
and retrieve it like this:
status = torture_rpc_connection(tctx,
(struct dcerpc_pipe **)data,
(const struct dcerpc_interface_table *)tctx->active_tcase->data);
that will crash, as tcase->data now contains a stack value from a
returned function. So it points off into space.
I think the correct fix is:
tcase->data = discard_const(table);
alternatively, make tcase->data a const.
Another example of "don't just fix a warning, fix the bug" :-)
Cheers, Tridge
More information about the samba-technical
mailing list