[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Mon Mar 22 19:06:47 MDT 2010


On Mon, 2010-03-22 at 23:09 +0100, Jelmer Vernooij wrote:
> Hi Matthias,
> 
> 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). 

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/62e5f556/attachment.pgp>


More information about the samba-technical mailing list