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

Checking for NULL from svn_wc_entry

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2006-02-22 01:24:22 CET

So after the problem with the crash involving diff, nonrecursive
checkouts, and deleted directories, I decided to investigate how we
deal with possible NULL entries returned by svn_wc_entry. The return
value of this function is based on the contents of the .svn/entries
file, so it's possible for crashes to result from users accidentally
mangling those files, which is bad.

There are approximately 20 places in libsvn_wc (I haven't looked in
other libraries) that have somewhat questionable handling of the
result of that function. I've got a patch here that fixes a bunch of
them, but I'm not the best with libsvn_wc, so I wanted to run it by
someone else.

There's also a question in 3 of the cases, the check might not be
needed at all. If we're using svn_wc_adm_access_path to get the path
argument, does that mean the entry will already be cached and thus
can't be NULL? If so, the parts marked with /* XXX ??? */ comments in
libsvn_wc/log.c are safe, otherwise they need attention.

As far as this patch goes, there are 16 places where it inserts checks
that return error if the entry is NULL, and 1 place where it fixes the
check that was there to refer to the correct variable. It makes it
through make check, but I haven't done a whole lot else with it at
this point.

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Wed Feb 22 01:25:12 2006

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.