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

Re: svn commit: rev 7886 - in trunk/subversion: include libsvn_subr

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-11-30 21:15:34 CET

dionisos@tigris.org writes:

> +static svn_error_t *
> +do_io_file_wrapper_cleanup (apr_file_t *file, apr_status_t status,
> + const char *op, apr_pool_t *pool)
> +{
> + const char *name;
> + const char *errstr;
> + char errbuf[255];
> + svn_error_t *err;
> +
> + if (! status)
> + return SVN_NO_ERROR;
> +
> + err = file_name_get (&name, file, pool);
> + name = (name && ! err) ? apr_psprintf (pool, "file '%s'", name) : "stream";

Trying to use name if file_name_get returned an error will provoke
undefined behaviour if name has not be assigned a value. Do it like
this

     name = (! err && name) ...

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Nov 30 21:16:05 2003

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.