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

Re: malformed argument re-use in svn_client_url_from_path2

From: Ben Reser <ben_at_reser.org>
Date: Thu, 24 Oct 2013 13:12:01 -0700

On 10/24/13 11:44 AM, Maximo, Andre (GE Global Research) wrote:
> void CVCS::svnURLPath(CString& urlPath, const CString &fullPath)
>
> {
>
> apr_pool_t *local_pool = svn_pool_create(m_svn_pool);
>
> const char *url = NULL;
>
> svn_error_t *err = svn_client_url_from_path2(&url, fullPath, m_svn_ctx,
> m_svn_pool, local_pool);
>
> if (url != NULL)
>
> urlPath = CString(url);
>
> svn_pool_destroy(local_pool);
>
> }
>
>
>
> Where “m_svn_ctx” and “m_svn_pool” are pointers to class member context and
> main pool. What happens is that when I call this method for a valid fullPath
> it returns a valid urlPath. But, if I passed a non-existent fullPath, the code
> crashes at the “svn_client_url_from_path2”.

I'm not seeing a problem with our code based on the condition you've
identified. We have almost identical code in the svn_cl__revprop_prepare()
which is in subversion/svn/props.c to what you're doing. The only differences
that I see are we aren't using a separate scratch and result pool and we
actually check the error response from svn_client_url_from_path2(). The
incoming URL pointer we use is NULL just like yours.

I can excercise the above mentioned code path by doing the following:
svn propget -r 1535399 --revprop svn:date FAKEPATH
(where FAKEPATH doesn't exist)

I don't get crashes with 1.7, 1.8 or trunk. Out of curiosity I went and added
a scratch pool to the code and still didn't get any crashes.

Perhaps there is some other condition required to replicate your issue?
Received on 2013-10-24 22:13:23 CEST

This is an archived mail posted to the Subversion Users mailing list.

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