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

Re: svn commit: r29659 - trunk/subversion/svnserve

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: Sat, 1 Mar 2008 02:26:00 -1100

On Sat, Mar 1, 2008 at 5:58 AM, <glasser_at_tigris.org> wrote:
> Author: glasser
> Date: Fri Feb 29 20:58:59 2008
> New Revision: 29659
>
> Log:
> Clear a bunch of error leaks in the svnserve Cyrus SASL
> implementation.
>
> * subversion/svnserve/cyrus_auth.c
> (fail_cmd, cyrus_auth_request): Clear all errors written to the
> client.
>
>
> Modified:
> trunk/subversion/svnserve/cyrus_auth.c
>
> Modified: trunk/subversion/svnserve/cyrus_auth.c
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/svnserve/cyrus_auth.c?pathrev=29659&r1=29658&r2=29659
> ==============================================================================
> --- trunk/subversion/svnserve/cyrus_auth.c (original)
> +++ trunk/subversion/svnserve/cyrus_auth.c Fri Feb 29 20:58:59 2008
> @@ -139,6 +139,7 @@
> svn_error_t *err = svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
> sasl_errdetail(sasl_ctx));
> SVN_ERR(svn_ra_svn_write_cmd_failure(conn, pool, err));
> + svn_error_clear(err);

This still leaves an error leak when the
svn_ra_svn_write_cmd_failure() function fails. Same in the other
cases. It's probably better to catch the result from
svn_ra_svn_write_cmd_failure() in order to be able to clear err and
return the result.

> return svn_ra_svn_flush(conn, pool);
> }
>
> @@ -242,6 +243,7 @@
> {
> svn_error_t *err = svn_error_wrap_apr(apr_err, _("Can't get hostname"));
> SVN_ERR(svn_ra_svn_write_cmd_failure(conn, pool, err));
> + svn_error_clear(err);
> return svn_ra_svn_flush(conn, pool);
> }
>
> @@ -257,6 +259,7 @@
> svn_error_t *err = svn_error_create(SVN_ERR_RA_NOT_AUTHORIZED, NULL,
> sasl_errstring(result, NULL, NULL));
> SVN_ERR(svn_ra_svn_write_cmd_failure(conn, pool, err));
> + svn_error_clear(err);
> return svn_ra_svn_flush(conn, pool);
> }
>
> @@ -311,6 +314,7 @@
> _("Could not obtain the list"
> " of SASL mechanisms"));
> SVN_ERR(svn_ra_svn_write_cmd_failure(conn, pool, err));
> + svn_error_clear(err);
> return svn_ra_svn_flush(conn, pool);
> }
>
> @@ -351,6 +355,7 @@
> _("Couldn't obtain the authenticated"
> " username"));
> SVN_ERR(svn_ra_svn_write_cmd_failure(conn, pool, err));
> + svn_error_clear(err);
> return svn_ra_svn_flush(conn, pool);
> }
> }

Bye,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-03-01 14:26:12 CET

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