CVS update: samba/source/rpc_parse

Jean Francois Micouleau Jean-Francois.Micouleau at dalalu.fr
Wed Jul 11 04:20:39 EST 2001


On Tue, 10 Jul 2001 abartlet at samba.org wrote:

> The RPC code is currently littered with code that does init_uni_hdr() followed
> immidiatly by init_unistr2(), and often the length argument is wrong.  (It was
> for the code I changed, even before the charset stuff).  Another bug where we
> made strings AT LEAST MAX_UNICODE_LEN long hid this bug.

your patch is wrong.

the header length is USUALLY (with some exceptions) the number of bytes
and not the number of characters.

A UNISTR2 is not always NULL terminated. On some pipes and certains rpc
functions, the string must be NON NULL terminated with uni_str_len being
the length of the string and uni_max_len the length plus 1.

and btw, you're not checking if str and hdr ptrs are NON NULL before
affecting values.

	J.F.


>
> This works for loopback connections to Samba, and can't be any more broke than
> it was before :-).  (We had double and revese conversions, fun...).
>
> In particular this makes us multibyte complient.
>
> In any case, if there are no objections I will slowly convert other bits of
> code to the same system.
>
>
> Revisions:
> parse_misc.c		1.82 => 1.83
> 	http://www.samba.org/cgi-bin/cvsweb/samba/source/rpc_parse/parse_misc.c?r1=1.82&r2=1.83
> parse_net.c		1.55 => 1.56
> 	http://www.samba.org/cgi-bin/cvsweb/samba/source/rpc_parse/parse_net.c?r1=1.55&r2=1.56
>
>





More information about the samba-cvs mailing list