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

svn_client_lock() segfaults with empty paths

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


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_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;


   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 15 20:26:27 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.