You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2015/01/14 19:18:55 UTC
svn commit: r1651759 - /subversion/trunk/subversion/libsvn_subr/error.c
Author: rhuijben
Date: Wed Jan 14 18:18:55 2015
New Revision: 1651759
URL: http://svn.apache.org/r1651759
Log:
When duplicating errors (svn_error_t) also duplicate the filename to the new
error's pool, to avoid problems with filenames that are generated outside the
application.
* subversion/libsvn_subr/error.c
(svn_error_compose,
svn_error_dup): Duplicate filename in the error pool, to properly handle
the case where the filename is not allocated statically.
Modified:
subversion/trunk/subversion/libsvn_subr/error.c
Modified: subversion/trunk/subversion/libsvn_subr/error.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/error.c?rev=1651759&r1=1651758&r2=1651759&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/error.c (original)
+++ subversion/trunk/subversion/libsvn_subr/error.c Wed Jan 14 18:18:55 2015
@@ -288,6 +288,8 @@ svn_error_compose(svn_error_t *chain, sv
*chain = *new_err;
if (chain->message)
chain->message = apr_pstrdup(pool, new_err->message);
+ if (chain->file)
+ chain->file = apr_pstrdup(pool, new_err->file);
chain->pool = pool;
#if defined(SVN_DEBUG)
if (! new_err->child)
@@ -364,6 +366,8 @@ svn_error_dup(const svn_error_t *err)
tmp_err->pool = pool;
if (tmp_err->message)
tmp_err->message = apr_pstrdup(pool, tmp_err->message);
+ if (tmp_err->file)
+ tmp_err->file = apr_pstrdup(pool, tmp_err->file);
}
#if defined(SVN_DEBUG)