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

Re: [PATCH 2] Allocating large buffers on the stack was: Re: Subversion 1.2.0 RC3 (final candidate) on Monday?

From: Jani Averbach <jaa_at_jaa.iki.fi>
Date: 2005-05-09 03:23:46 CEST

On 2005-05-08 16:04+0200, Patrick Mayweg wrote:

> Index: subversion/libsvn_subr/subst.c
> ===================================================================
> --- subversion/libsvn_subr/subst.c (revision 14544)
> +++ subversion/libsvn_subr/subst.c (working copy)
> @@ -591,9 +591,10 @@
> const char *eol_str,
> svn_boolean_t repair,
> const svn_subst_keywords_t *keywords,
> - svn_boolean_t expand)
> + svn_boolean_t expand,
> + apr_pool_t *pool)
> {
> - char buf[SVN_STREAM_CHUNK_SIZE + 1];
> + char *buf = apr_palloc(pool, SVN_STREAM_CHUNK_SIZE + 1);
> const char *p, *interesting;
> apr_size_t len, readlen;
> apr_size_t eol_str_len = eol_str ? strlen (eol_str) : 0;

Same thing here, sizeof used with dynamically allocated buffer.
  ...
  readlen = sizeof (buf) - 1;
  while (readlen == sizeof (buf) - 1)
   ...

BR, Jani

-- 
Jani Averbach
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon May 9 03:24:32 2005

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