iconv_inconvenience and ndr_print_*

Andrew Bartlett abartlet at samba.org
Fri Jun 12 01:21:29 GMT 2009


On Fri, 2009-06-12 at 02:29 +0200, Jelmer Vernooij wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hi Tridge,
> 
> tridge at samba.org wrote:
> > The ndr_print_*() functions can end up calling string conversions via
> > ndr_size_*() functions which call ndr_push functions, which call
> > string conversion.
> > 
> > Unfortunately ndr_print_*() functions create their own "struct
> > ndr_print" structures, and don't setup ndr->iconv_convenience. So it
> > segfaults when the first structure with a string is run through a
> > ndr_size call.
> > 
> > My fix at the moment is below, but I suspect you may want a different
> > approach.
> Ideally we should be specifying the iconv convenience to all of these
> functions, but I'm not sure how doable that is given the large number of
> callers.
> 
> Your patch is a step forward at least (crashing is bad :-), we can
> always change the callers to explicitly specify an iconv convenience later.

Don't we just need to change the pidl output and ndr_print_debug() and
associated macros to look at p->conn->iconv_convenience?

Andrew Bartlett

-- 
Andrew Bartlett
http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Red Hat Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20090612/74a9ac65/attachment.bin


More information about the samba-technical mailing list