CVS update: samba/source/rpc_parse

Andrew Bartlett abartlet at pcug.org.au
Wed Jul 11 11:59:27 EST 2001


Jeremy Allison wrote:
> 
> Jean Francois Micouleau 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.

OK, I assumed some sanity where there obviously is none.

> > 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.

Any chance of making this clearer in the header files defining the
structures or the functions creating them?  So the next poor sod who
thinks 'I can fix that' doesn't end up in the same mess?

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

Neither does the code I was replacing...  (init_unistr2 and
init_str_hdr).

> Andrew, can you roll back your patch please and pass it via
> JF for correctlness checks before committing it again.
> 
> tridge and I are a little tied up right now so can't give
> this the attention it deserves.

I'll roll it back to a fixed for English, broken for multibyte stage,
where assumptions about strlen()*2 prevail.

Andrew Bartlett

-- 
Andrew Bartlett
abartlet at pcug.org.au
abartlet at samba.org




More information about the samba-cvs mailing list