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

Re: svn commit: r13080 - in trunk/subversion: clients/cmdline include libsvn_client libsvn_wc

From: Michael W Thelen <mike_at_pietdepsi.com>
Date: 2005-03-01 10:36:59 CET

bliss@tigris.org wrote:
> Modified: trunk/subversion/libsvn_client/prop_commands.c
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_client/prop_commands.c?view=diff&rev=13080&p1=trunk/subversion/libsvn_client/prop_commands.c&r1=13079&p2=trunk/subversion/libsvn_client/prop_commands.c&r2=13080
> ==============================================================================
> --- trunk/subversion/libsvn_client/prop_commands.c (original)
> +++ trunk/subversion/libsvn_client/prop_commands.c Sat Feb 19 17:47:38 2005
> @@ -579,8 +579,10 @@
> {
> svn_boolean_t pristine;
>
> - SVN_ERR (svn_wc_adm_probe_open2 (&adm_access, NULL, target,
> - FALSE, recurse ? -1 : 0, pool));
> + SVN_ERR (svn_wc_adm_probe_open3 (&adm_access, NULL, target,
> + FALSE, recurse ? -1 : 0,
> + ctx->cancel_func, ctx->cancel_baton,
> + pool));
> SVN_ERR (svn_wc_entry (&node, target, adm_access, FALSE, pool));
> if (! node)
> return svn_error_createf

This change causes a segmentation fault whenever "svn propedit" is run,
because ctx is NULL. Here's a patch to fix it. I don't know enough
about the code to tell what other context pointers may be NULL. Is it
worth guarding all such dereferences?

[[[
Guard dereference of a potentially NULL pointer.

* libsvn_client/prop_commands.c
   (svn_client_propget2): Do not dereference ctx if it is NULL.
]]]

Index: subversion/libsvn_client/prop_commands.c
===================================================================
--- subversion/libsvn_client/prop_commands.c (revision 13208)
+++ subversion/libsvn_client/prop_commands.c (working copy)
@@ -590,7 +590,8 @@

        SVN_ERR (svn_wc_adm_probe_open3 (&adm_access, NULL, target,
                                         FALSE, recurse ? -1 : 0,
- ctx->cancel_func, ctx->cancel_baton,
+ ctx ? ctx->cancel_func : NULL,
+ ctx ? ctx->cancel_baton : NULL,
                                         pool));
        SVN_ERR (svn_wc_entry (&node, target, adm_access, FALSE, pool));
        if (! node)

--
Michael W Thelen
It is a mistake to think you can solve any major problems just with
potatoes.       -- Douglas Adams

Received on Tue Mar 1 10:39:35 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.