[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Mon Mar 22 22:38:35 MDT 2010


On Tue, 2010-03-23 at 01:52 +0000, Jelmer Vernooij wrote:
> On Tue, 2010-03-23 at 12:06 +1100, Andrew Bartlett wrote:
> > On Mon, 2010-03-22 at 23:09 +0100, Jelmer Vernooij wrote:
> > > Can you please send patches to the registry in for review first?
> > 
> > > > +			if (data.length % 2 == 0) {
> > > > +				/* The data is provided as UTF16 string */
> > > > +				ret2 = convert_string_talloc(mem_ctx, CH_UTF16, CH_UTF8,
> > > > +							     (void *)data.data, data.length,
> > > > +							     (void **)&val->data,&val->length,
> > > > +							     false);
> > > > +				if (!ret2) {
> > > > +					talloc_free(msg);
> > > > +					return NULL;
> > > > +				}
> > > >
> > > ^^ This isn't necessarily true ? What if there is an uneven number of 
> > > characters in a UTF-8 string? In that case the length of that string 
> > > would be even.
> > 
> > I think mdw is right here.  If the data is not a multiple of 2 bytes,
> > how is converting from UTF16 to UTF8 ever going to work, so why bother
> > trying?  (if we try, we may just fill the logs with DEBUG() message). 
> Not trying as UTF16 if length % 2 != 0 seems appropriate, but /only/
> trying UTF16 and not trying UTF8 if length % 2 == 0 seems inappropriate.

Matthias:

Where does 'data' come from here?  From the wire or from the DB?  

If it comes from the wire, is UTF8 data ever valid on the wire for this
protocol, or is this a 'UCS2' buffer that happens to be able to contain
either UCS2, UTF16 or binary crap without error (but no real client puts
UTF8 there)?

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20100323/8ed1f73f/attachment.pgp>


More information about the samba-technical mailing list