CVS update: samba/source/rpcclient

Jean Francois Micouleau Jean-Francois.Micouleau at dalalu.fr
Fri Jan 17 20:21:22 EST 2003


On Thu, 16 Jan 2003 tridge at samba.org wrote:

> Log Message:
> This removes the 3rd argument from init_unistr2(). There were 240
> calls to init_unistr2() in the code and every one of them got the 3rd
> argument incorrect, so I thought it best just to remove the argument.
>
> The incorrect usage was caused by callers using strlen() to determine
> the length of the string. The 3rd argument to init_unistr2() was
> supposed to be the character length, not the byte length of the
> string, so for non-english this could come out wrong.

tridge, you're sure of what you're doing here ?

depending on how the string is passed (data or ptr), on the pipe (LSA
comes to mind), and the phase of the moon and the different SP, all the
unicode strings are not equal !

Some strings are raw strings (not NULL terminated), max length=length
some can be terminated max len=len including the NULL
some can be not terminated but max len=len+1

then you have the LSA case where they reimplemented their unicode support

then you have the unihdr stuff (struct pointing to the string), where the
length is in bytes.

I *like* that stuff, 4 teams, 4 different implementations, they have yet a
long way to go before give advices on code quality :)

	J.F.





More information about the samba-cvs mailing list