How to use ndr_pull_struct_blob?
Volker Lendecke
Volker.Lendecke at SerNet.DE
Sat Jan 1 14:12:43 MST 2011
Hi, Tridge!
In master I see a valgrind error in
net lookup dsgetdcname <domain>
that I can't solve easily:
==49827== Invalid read of size 1
==49827== at 0x85F6E39: make_dc_info_from_cldap_reply (dsgetdcname.c:740)
==49827== by 0x85F8519: dsgetdcname (dsgetdcname.c:357)
==49827== by 0x80FFF02: net_lookup_dsgetdcname (net_lookup.c:419)
==49827== by 0x8100A81: net_lookup (net_lookup.c:460)
==49827== by 0x8117EE0: net_run_function (net_util.c:585)
==49827== by 0x80E86AE: main (net.c:933)
==49827== Address 0x66b110 is 48 bytes inside a block of size 49 free'd
==49827== at 0x58CDC: free (in /usr/local/lib/valgrind/vgpreload_memcheck-x86-freebsd.so)
==49827== by 0x862E786: _talloc_free_internal (talloc.c:699)
==49827== by 0x862E713: _talloc_free_internal (talloc.c:652)
==49827== by 0x83BB0C3: ndr_pull_struct_blob (ndr.c:873)
==49827== by 0x85F8409: dsgetdcname (dsgetdcname.c:348)
==49827== by 0x80FFF02: net_lookup_dsgetdcname (net_lookup.c:419)
==49827== by 0x8100A81: net_lookup (net_lookup.c:460)
==49827== by 0x8117EE0: net_run_function (net_util.c:585)
==49827== by 0x80E86AE: main (net.c:933)
To me it seems that the talloc_free in ndr_pull_struct_blob
takes away the allocated structures inside the parse
function.
Do you have an idea how I can use ndr_pull_struct_blob
correctly, so that this valgrind error does not happen?
This also happens in 3.5, and if I count the number of calls
to ndr_pull_struct_blob I get the impression that this might
be a pretty popular valgrind error.
With best regards,
Volker
--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
More information about the samba-technical
mailing list