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

Re: [PATCH] fix a crash in libsvn_wc

From: Philip Martin <philip.martin_at_wandisco.com>
Date: Wed, 29 Aug 2012 09:37:14 +0100

George Gugulea <gugulea_at_gmail.com> writes:

> [[[
> Used from the kdevelop subversion plugin, the db pointers comes NULL. This
> should be treated one way or another, I choose to return error and not an
> assert because it might be a recoverable error. This should be reviewed and
> an appropriate action should be taken.
> ]]]
>
> attached is the patch for the last svn revision (1378109) of the file
> --
> gg
>
> Index: wc_db_wcroot.c
> ===================================================================
> --- wc_db_wcroot.c (revision 1378109)
> +++ wc_db_wcroot.c (working copy)
> @@ -374,6 +374,17 @@
> int wc_format = 0;
> const char *adm_relpath;
>
> + /* gg:
> + Test the db pointer if NULL: assert if that's ok or take some acction
> + (return an error)
> + For some reason kdevelop subversion module crashes here because of that
> + */
> +
> + if (db == NULL)
> + {
> + return svn_error_createf(SVN_ERR_WC_NOT_WORKING_COPY, NULL, NULL);
> + }
> +
> /* ### we need more logic for finding the database (if it is located
> ### outside of the wcroot) and then managing all of that within DB.
> ### for now: play quick & dirty. */

Does the plugin call svn_client_create_context or svn_wc_context_create?
It must do one or the other, if it simply allocates a structure and sets
the fields to zero then the plugin has a bug (rapidsvn had the same
bug).

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download
Received on 2012-08-29 10:37:54 CEST

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.