Coverity errors in libndr/

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Oct 25 10:41:12 GMT 2006

On Wed, Oct 25, 2006 at 08:20:54PM +1000, tridge at wrote:
> In my attempt to be humorous I left off the obvious exception -
> anything that could be an allocation failure obviously does need to be
> checked. It's not OK to segv on allocation failure (or failing to
> mmap, failing to open a file etc etc). So I think we do need one check
> when we allocate a new attribute, but if the attribute does get added
> OK then we don't need to check the case that its null afterwards.

I was not talking about ldb, I was talking about generated
NDR marshalling code. In ndr_echo.c starting with line 1162
we have the following code fragment:

      ndr_print_echo_Enum1(ndr, "foo1", *r->in.foo1);
      ndr_print_ptr(ndr, "foo2", r->in.foo2);
      ndr_print_echo_Enum2(ndr, "foo2", r->in.foo2);
      ndr_print_ptr(ndr, "foo3", r->in.foo3);
      if (r->in.foo1 == NULL) return;

I think the last line is bogus, as in the first line we
already segfaulted. Or should I mark these as wontfix in


More information about the samba-technical mailing list