[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r16735 - in trunk/subversion: libsvn_subr libsvn_wc

From: Kouhei Sutou <kou_at_cozmixng.org>
Date: 2005-10-16 08:01:53 CEST

Hi,

I'm sorry for my unclear explain.

In <df2177af0510152245v70ced4dbj40a113d03028ad31@mail.gmail.com>
  "Re: svn commit: r16735 - in trunk/subversion: libsvn_subr libsvn_wc" on Sun, 16 Oct 2005 01:45:13 -0400,
  David James <james82@gmail.com> wrote:

> > > + *new_item = *item;
> > > +
> > > + if (new_item->path)
> >
> > if (new_item->kind && new_item->path)
> >
> > We need to check new_item->kind value is svn_node_none or
> > not.
> Really? I did not know this. Why?

When item->kind is svn_node_none, item->path value may be
not initialized.

For example from mkdir_urls() in libsvn_client/commit.c:

          item = apr_pcalloc (pool, sizeof (*item));
          item->url = svn_path_join (common, path, pool);
          item->state_flags = SVN_CLIENT_COMMIT_ITEM_ADD;

item->path and item->kind are not initialized. So
item->path's value isn't ensured. But item->kind value
is initialized as 0 (= svn_node_none) because
svn_node_kind_t which is item->kind type is enum type.

> > Or we initialize item->path as NULL if item->path is
> > not available.
> We copy *new_item = *item, so new_item->path will be NULL if item->path is NULL.

I worry about item->path is not initialized as NULL.

> > > + if (new_item->wcprop_changes)
> >
> > I think we need to check new_item->wcprop_changes is
> > available or not. But I don't know the way...
> If new_item->wcprop_changes is not available, it would be NULL, right?

I don't think so. The reason of this is same as new_item->path.

> > Can we initialize item->wcprop_changes as NULL?
> We copy *new_item = *item, so new_item->wcprop_changes will be NULL if
> item->wcprop_changes is NULL.

I worry about item->wcprop_changes is not initialized as NULL.

Cheers,

--
kou
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Oct 16 08:02:34 2005

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.