[Spread-users] Vlagrind reports uninitialised or unaddressable byte(s) in SP_disconnect
Theo Schlossnagle
jesus at omniti.com
Thu May 27 16:24:58 EDT 2004
On May 27, 2004, at 1:13 PM, John Schultz wrote:
> I'm pretty sure this is not a REAL problem. However, all the Spread
> code should adopt a uniform way of initializing, copying and passing
> group names around.
>
> I believe that the "right" way to do this is to zero out one past the
> last character of the name and the rest of the buffer, which is what
> most of the Spread code does. So, that strcpy should probably be
> changed to a memcpy, or the pointer should just be passed directly.
> The Spread daemon should ensure that these bytes are zeroed out in
> group names anyway so it doesn't actually hurt to not set them to zero
> in the client.
Yes. That is the right way to do it... or not to copy the portions
that could be trash. In the end, this code may not produce side
effects, but it triggers a valgrind warning, which will detract from
the importance of other valgrind warnings. Valgrind speaks gospel.
Listen, believe, and follow.
// Theo Schlossnagle
// Principal Engineer -- http://www.omniti.com/~jesus/
// OmniTI Computer Consulting, Inc. -- http://www.omniti.com/
// Ecelerity: fastest MTA on Earth
More information about the Spread-users
mailing list