[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-584-gb40efc2

Jeremy Allison jra at samba.org
Mon Dec 10 23:02:16 GMT 2007


On Mon, Dec 10, 2007 at 11:57:19PM +0100, Andreas Schneider wrote:
> Jeremy Allison wrote:
> > The branch, v3-2-test has been updated
> >        via  b40efc2fe63a3420b62fbf1ea8936112c5a24bdc (commit)
> >       from  70950b419a57465c38bb36722644b95b1d14f76d (commit)
> > 
> > http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
> > 
> > 
> > - Log -----------------------------------------------------------------
> > commit b40efc2fe63a3420b62fbf1ea8936112c5a24bdc
> > Author: Jeremy Allison <jra at samba.org>
> > Date:   Mon Dec 10 14:21:28 2007 -0800
> > 
> >     Fix errors from next_token conversion. Spotted by
> >     Andreas Schneider <anschneider at suse.de>.
> >     Jeremy.
> > 
> > -----------------------------------------------------------------------
> > 
> > Summary of changes:
> >  source/libsmb/namequery.c |   14 +++++---------
> >  1 files changed, 5 insertions(+), 9 deletions(-)
> > 
> > 
> > Changeset truncated at 500 lines:
> > 
> > diff --git a/source/libsmb/namequery.c b/source/libsmb/namequery.c
> > index 0decc59..c0d6b6e 100644
> > --- a/source/libsmb/namequery.c
> > +++ b/source/libsmb/namequery.c
> > @@ -791,12 +791,12 @@ bool getlmhostsent(TALLOC_CTX *ctx, XFILE *fp, char **pp_name, int *name_type,
> >  	*pp_name = NULL;
> >  
> >  	while(!x_feof(fp) && !x_ferror(fp)) {
> > -		char *ip;
> > -		char *flags;
> > -		char *extra;
> > -		char *name;
> > +		char *ip = NULL;
> > +		char *flags = NULL;
> 
> Hi Jeremy,
> 
> this will lead to a segfault in strchr_m() now. This function doesn't check if
> 'src' is NULL and tries to access the first char of the string with *s in the
> for loop.
> 
> I think we should initialize 'flags' with an empty string in this case.

This parsing can take min of 2, max of 4 strings. So we should
talloc_strdup(ctx,"") for the last 2 I think. Fix on the way...

Jeremy.


More information about the samba-technical mailing list