[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: Branko Čibej <brane_at_wandisco.com>
Date: Thu, 24 Oct 2013 22:41:07 +0200

On 24.10.2013 22:36, Ben Reser wrote:
> 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);
>>
>> }
> Looking at this code more closely I see that you're passing
> svn_client_url_from_path2() a pointer to a CString class. I'm guessing you're
> using MFC based on that class name.

And MFC CString has a conversion operator to 'const char*' (actually,
LPCTSTR, but the C++ compiler would barf if that were actually a 'const
wchar_t*'). It's bad class design, but that's a different topic. :)

-- Brane

-- 
Branko Čibej | Director of Subversion
WANdisco // Non-Stop Data
e. brane_at_wandisco.com
Received on 2013-10-24 22:41:43 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.