init_uni_hdr() problem

Andrew Bartlett abartlet at pcug.org.au
Wed Oct 24 14:30:30 GMT 2001


TAKAHASHI Motonobu wrote:
> 
> Andrew Bartlett wrote:
> 
> >I looked at this problem a little while back and produced the
> >following patch:
> >
> >http://samba.org/cgi-bin/samba-patches/incoming?id=479;expression=abartlet;user=guest
> >
> >Can you give it a test - I think it solves the problem a little better.
> 
> No, these variable must be set the number of chars in Unicode.
> And at least Japanese Unicode char number is NOT same as strlen(str).
> Nor NOT len_bytes/sizeof(unit16).

But would it be ok with an extra check on null_termination?  I suppose
what I'm saying is that we only really want to be doing the conversion
once, not once to find out the length and another time when we actually
start converting things.

I've shown myself to be a complete non-expert in this area, so take this
with a *massive* grain of salt.

Thanks,

Andrew Bartlett

-- 
Andrew Bartlett                                 abartlet at pcug.org.au
Samba Team member, Build Farm maintainer        abartlet at samba.org
Student Network Administrator, Hawker College   abartlet at hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net




More information about the samba-technical mailing list