svn commit: samba r11975 - branches/SAMBA_3_0/source/libsmb trunk/source/libsmb

Jeremy Allison jra at samba.org
Wed Nov 30 22:41:49 GMT 2005


On Thu, Dec 01, 2005 at 09:26:06AM +1100, Andrew Bartlett wrote:
> On Wed, 2005-11-30 at 17:29 +0000, vlendec at samba.org wrote:
> > Author: vlendec
> > Date: 2005-11-30 17:29:33 +0000 (Wed, 30 Nov 2005)
> > New Revision: 11975
> > 
> > WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11975
> > 
> > Log:
> > Fix valgrind error -- bug 3291
> > Modified:
> >    branches/SAMBA_3_0/source/libsmb/cliconnect.c
> >    trunk/source/libsmb/cliconnect.c
> > 
> > 
> > Changeset:
> > Modified: branches/SAMBA_3_0/source/libsmb/cliconnect.c
> > ===================================================================
> > --- branches/SAMBA_3_0/source/libsmb/cliconnect.c	2005-11-30 17:07:02 UTC (rev 11974)
> > +++ branches/SAMBA_3_0/source/libsmb/cliconnect.c	2005-11-30 17:29:33 UTC (rev 11975)
> > @@ -163,6 +163,7 @@
> >  	char *p;
> >  	uint32 capabilities = cli_session_setup_capabilities(cli);
> >  
> > +	memset(cli->outbuf, '\0', smb_size);
> >  	set_message(cli->outbuf,13,0,True);
> >  	SCVAL(cli->outbuf,smb_com,SMBsesssetupX);
> >  	cli_setup_packet(cli);
> 
> Do you *really* want to spend CPU time zeroing every packet?  I know we
> have specifically avoided doing so in the past...

This is not zeroing every packet, it's zeroing the header portion
of this specific session setup packet, as we're not going through each
byte in the :

SCVAL(cli->outbuf,smb_vwvXX)

step below. It's a one off, no big deal. Could have been fixed by adding
SCAL's for the missing smb_vwv numbers, but in this case it's easier
to just memset the 39 byte header (IMHO).

Jeremy.


More information about the samba-technical mailing list