[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Mon Mar 22 19:52:38 MDT 2010


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.

Cheers,

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


More information about the samba-technical mailing list