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

RE: svn commit: r36202 - trunk/subversion/libsvn_ra_serf

From: Bert Huijben <rhuijben_at_sharpsvn.net>
Date: Fri, 27 Feb 2009 23:16:07 +0100

> -----Original Message-----
> From: Ivan Zhakov [mailto:ivan_at_visualsvn.com]
> Sent: Friday, February 27, 2009 11:04 PM
> To: dev_at_subversion.tigris.org; rhuijben_at_sharpsvn.net
> Subject: Re: svn commit: r36202 - trunk/subversion/libsvn_ra_serf
>
> On Sat, Feb 28, 2009 at 12:50 AM, Bert Huijben <rhuijben_at_sharpsvn.net>
> wrote:
> > @@ -280,7 +281,7 @@ handle_checkout(serf_request_t *request,
> > }
> > apr_uri_parse(pool, location, &uri);

This allocates uri in pool.

> >
> > - ctx->resource_url = apr_pstrdup(ctx->pool, uri.path);
> > + ctx->resource_url = svn_uri_canonicalize(uri.path, ctx->pool);
> > }
> You introduce memory management error here, because
> svn_uri_canonicalize() does not guarantee that passed uri will be
> copied to pool. See include\svn_direent_uri.h:323
> [[[
> * The returned uri may be statically allocated, equal to @a uri, or
> * allocated from @a pool.
> ]]]

As uri is also allocated in pool, this can't create lifetime issues.

        Bert

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1241136
Received on 2009-02-27 23:16:43 CET

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.