libmsrpc for Samba 3

tridge at samba.org tridge at samba.org
Wed Jul 20 23:55:49 GMT 2005


Jeremy,

 > > And the unitialized fields will happen more than you think.
 > 
 > Wouldn't valgrind be the fix here ?

yes, the programmer has two choices to fix this:

1) zero the structures before use

2) don't zero, and use valgrind to catch use of uninitialised
   variables.

The 2nd choice is the better one, but only works if you are on a
platform that has valgrind or an equivalent tool.

I don't see this as being a big distinguishing feature between
parameters and 'control block' anyway, as parameters just move the
control block down a level. A huge number of RPC calls pass a
structure as one or more of the arguments, so even if you use the
parameter approach you are left with the same problem, and the same
two solutions.

Cheers, Tridge


More information about the samba-technical mailing list