[netfilter-cvslog] r3629 - trunk/iptables/libiptc

Rusty Russell rusty at rustcorp.com.au
Wed Feb 2 02:57:14 CET 2005

On Tue, 2005-02-01 at 14:28 +0100, laforge at netfilter.org wrote:

> - Adds a couple of memset() invocations in TC_COMMIT, based on past analysis with valgrind.
>  It claimed that allocated structure were not being fully initialized, and adding the
>  memset()s corrected this warning.       
> (Derrik Pates <demon at devrandom.net>)

But if the warning is real, this just papers over it.  I'd prefer to see
more analysis (unless it's already been done).  One trick to catch
exactly where valgrind thinks isn't initialized is insert a call to
something like:

	/* Do a branch on each byte, so valgrind will warn. */
	int check_initialized(void *data, int size)
		int i, count = 0;
		for (i = 0; i < size; i++)
			count += ((char *)data)[i] ? 1 : 0;
		return count;

A bad analogy is like a leaky screwdriver -- Richard Braakman

More information about the netfilter-cvslog mailing list