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

[TSVN] svn_client_lock() sefaults with empty paths

From: Stefan Küng <steveking_at_gmx.ch>
Date: 2005-08-15 20:21:33 CEST

Hi,

Crashreport analyze time for TSVN again ;)

While doing that, I found that svn_client_lock() segfaults if the first
param (const apr_array_header_t *) contains zero elements, i.e. if no
paths to lock are passed to the function.

I know I should not call svn_client_lock() if there's nothing to lock at
all in TSVN, so I can get rid of the crashreports I receive on my own.
But still, I think Subversion shouldn't segfault in such a case.

The reason for the crash:
svn_client_lock()
   organize_lock_targets()
    svn_path_condense_targets()

svn_path_condense_targets() returns NULL for 'common_parent' without an
error code. Then, in the next lines:

   if (apr_is_empty_array (rel_targets))
     {
/* here's the segfault, because *common_parent is NULL!
       char *base_name = svn_path_basename (*common_parent, pool);
       *common_parent = svn_path_dirname (*common_parent, pool);

       APR_ARRAY_PUSH (rel_targets, char *) = base_name;
     }

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Mon Aug 15 20:21:57 2005

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

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